ptwobrussell/Mining-the-Social-Web — Issue #15: Arrggg.  Twitter Trends
Author: Grashnak
Created: 2012-01-11 02:32:58+00:00
State: open

I'm sorry to beat a dead horse... I've read the errata, and tried to understand how example 1.3 has changed - and then seemingly changed again. But it looks so dead simple, but nothing I do seems to make it work.

Here is where I've ended up:

>>> import twitter
>>> twitter_api=twitter.Twitter(domain="api.twitter.com", api_version='1')
>>> trends=twitter_api.trends()

Traceback (most recent call last):
File "", line 1, in
File "build/bdist.macosx-10.7-intel/egg/twitter/api.py", line 165, in __call__
File "build/bdist.macosx-10.7-intel/egg/twitter/api.py", line 180, in _handle_response
twitter.api.TwitterHTTPError: Twitter sent status 404 for URL: 1/trends.json using parameters: ()
details:

(followed by a ton of HTML and CSS... )

Reading the API documentation, I'm pretty sure I need to be including some parameters in the line:

>>> twitter_api=twitter.Twitter(domain="api.twitter.com", api_version='1')

but no matter what I try it just doesn't work. I'm sure there's a simple solution, but I've bashed my head against it so long that I just can't see it.

Anyone care to show me what I'm doing wrong?

Thanks!
John