Closed christhorne closed 13 years ago
For Example 1-3, it looks like "twitter_search" should = "twitter.Twitter(domain="api.twitter.com") instead. Then the rest of the example code seems to work fine. Found the solution @ http://dev.twitter.com/doc/get/trends.
Chris - you're right that the URL you pointed out no longer resolves. At some point or another after printing, the trends API was migrated over to api.twitter.com, so try this one: https://api.twitter.com/trends.json
In code, all you have to do with the twitter python package is use the (default) domain keyword param of "api.twitter.com" and you should be in good shape.
I think we corrected this issue in the latest print run (and ebooks) but I should double check since it gave you some troubles.
Regards - Matthew
http://www.linkedin.com/in/ptwobrussell
On Jul 2, 2011, at 5:39 PM, ChrisThorne wrote:
Just got the book today and Example 1-3 does not appear to work on Page 5. I am brand new to python, but it appears that "http://search.twitter.com/trends.json" is no longer a page, or call, that exists. Am I missing something?
Thanks! Chris
Reply to this email directly or view it on GitHub: https://github.com/ptwobrussell/Mining-the-Social-Web/issues/7
Closing this issue since it does appear that we updated the book. O'Reilly ebook buyers should have long since gotten a free ebook update, and future print runs will also reflect the change.
Looks like api.twitter.com is no longer current.
twitter_search = twitter.Twitter(domain="api.twitter.com") twitter_search.domain 'api.twitter.com' trends = twitter_search.trends()
Traceback (most recent call last):
File "<pyshell#17>", line 1, in
Now from the developer page I see that the new place for grabbing trends is api.twitter.com/1/ . When I try that it still breaks. twitter_search = twitter.Twitter(domain="api.twitter.com/1/") twitter_search.domain 'api.twitter.com/1/' trends = twitter_search.trends()
Traceback (most recent call last):
File "<pyshell#20>", line 1, in
Just got the book today and Example 1-3 does not appear to work on Page 5. I am brand new to python, but it appears that "http://search.twitter.com/trends.json" is no longer a page, or call, that exists. Am I missing something?
Thanks! Chris