ptwobrussell / Mining-the-Social-Web

The official online compendium for Mining the Social Web (O'Reilly, 2011)
http://bit.ly/135dHfs
Other
1.21k stars 491 forks source link

example 1-3 does not work for me even when I go with domain="api.twitter.com" #25

Closed andyfFreeman-cisco-Kid closed 11 years ago

andyfFreeman-cisco-Kid commented 12 years ago

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 "", line 1, in trends = twittersearch.trends() File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 167, in _call return self._handle_response(req, uri, arg_data) File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 182, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 404 for URL: 1/trends.json using parameters: () details: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}

        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 "", line 1, in trends = twittersearch.trends() File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 167, in _call return self._handle_response(req, uri, arg_data) File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 182, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 404 for URL: trends.json using parameters: () details: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}

andyfFreeman-cisco-Kid commented 12 years ago

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 "", line 1, in trends = twittersearch.trends() File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 167, in _call return self._handle_response(req, uri, arg_data) File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 182, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 404 for URL: 1/trends.json using parameters: () details: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}

        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 "", line 1, in trends = twittersearch.trends() File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 167, in _call return self._handle_response(req, uri, arg_data) File "/opt/ActivePython-2.7/lib/python2.7/site-packages/twitter-1.8.0-py2.7.egg/twitter/api.py", line 182, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 404 for URL: trends.json using parameters: () details: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}

ptwobrussell commented 12 years ago

Can you take a look at this gist I wrote up and let me know if it helps? https://gist.github.com/1592859

ptwobrussell commented 11 years ago

With Twitter's v1.1 API and the recent commits for porting all Twitter code to the new API, this issue should effectively be resolved at this point.