Permalink
Browse files

Updating broken recipe due to Twitter API change earlier this year. S…

  • Loading branch information...
ptwobrussell committed Jan 11, 2012
1 parent 1be3fbb commit e2baf8677465819321e33dbc96ef6e487cf222ef
Showing with 6 additions and 1 deletion.
  1. +6 −1 recipe__get_trending_topics.py
@@ -5,4 +5,9 @@
t = twitter.Twitter(domain='api.twitter.com', api_version='1')
-print json.dumps(t.trends(), indent=1)
+WORLD_WOE_ID = 1 # The Yahoo! Where On Earth ID for the entire world
+
+world_trends = t.trends._(WORLD_WOE_ID) # get back a callable
+
+# call the callable and iterate through the trends returned
+print json.dumps([ trend for trend in world_trends()[0]['trends'] ], indent=1)

0 comments on commit e2baf86

Please sign in to comment.