Created
April 19, 2009 19:52
-
-
Save jiphex/98191 to your computer and use it in GitHub Desktop.
Script to print the current twitter 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 | |
try: | |
import simplejson as json #python <2.6 | |
except(ImportError): | |
import json as json #python 2.6+ | |
import urllib | |
trends = json.load(urllib.urlopen('http://api.twitter.com/1/trends/23424975.json'))[0] | |
trendlist = trends[trends.keys()[0]] | |
for trend in trendlist: | |
print trend['name'].encode("utf-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was designed as a pretty thing for GeekTool. Should work on a standard OSX python installation.