Created
March 27, 2016 02:09
-
-
Save axhixh/d198c6a27c0546ca46a8 to your computer and use it in GitHub Desktop.
Find places for which Twitter has trending topics. Can use the WOEID for the place in the list to get the actual trends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import json | |
| import tweepy | |
| from tweepy import OAuthHandler | |
| consumer_key = '' | |
| consumer_secret = '' | |
| access_token = '' | |
| access_secret = '' | |
| auth = OAuthHandler(consumer_key, consumer_secret) | |
| auth.set_access_token(access_token, access_secret) | |
| api = tweepy.API(auth) | |
| places = api.trends_available() | |
| with open('places.json','w') as out: | |
| out.write(json.dumps(places)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment