Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Last active October 13, 2015 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fmasanori/4121001 to your computer and use it in GitHub Desktop.
Save fmasanori/4121001 to your computer and use it in GitHub Desktop.
Python Twitter Trending Topics
#
# API DEPRECATED AT JUNE 2013
# https://dev.twitter.com/docs/faq#17750
#
import urllib, json
def trend_topics():
url = 'https://api.twitter.com/1/trends/1.json'
resp = urllib.urlopen(url).read()
data = json.loads(resp)
return data
for resp in trend_topics():
for trend in resp['trends']:
print (trend['name'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment