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

Trend_timeline not working #19

Closed Ramaznaz closed 11 years ago

Ramaznaz commented 12 years ago

I'm trying to run the code written here: https://github.com/ptwobrussell/Recipes-for-Mining-Twitter/blob/master/recipe__get_search_results_for_trending_topic.py

And get this:

Traceback (most recent call last): File "C:\Python27\trend_timeline.py", line 19, in trends = json.dumps(t.trends(), indent=1) File "C:\Documents and Settings\Zanzamar\Datos de programa\Python\Python27\site-packages\twitter\api.py", line 165, in call return self._handle_response(req, uri, arg_data) File "C:\Documents and Settings\Zanzamar\Datos de programa\Python\Python27\site-packages\twitter\api.py", line 180, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 404 for URL: 1/trends.json using parameters: () details: <!DOCTYPE html>

Twitter / ?

Sorry, that page doesn’t exist!

Thanks for noticing—we're going to fix it up and have things back to normal soon.

ptwobrussell commented 12 years ago

Are you running the actual code that is currently checked into GitHub or did you type it in out of the text that's printed in the paper book? I ask because the line of code that is causing the stack trace in your note above ( trends = json.dumps(t.trends(), indent=1) ) is nowhere in the file that you are citing (

https://github.com/ptwobrussell/Recipes-for-Mining-Twitter/blob/master/recipe__get_search_results_for_trending_topic.py

), although it used to be there in an earlier revision (see

https://github.com/ptwobrussell/Recipes-for-Mining-Twitter/commit/1be3fbb1ace322b1f88782a3d60ed1abb9e6d6ad#recipe__get_search_results_for_trending_topic.py
), which was updated because of Twitter changing their API on this particular call.

I believe the solution to the problem you are mentioning in this particular case (which was also alluded to in your Amazon review) may be that you just need to re-checkout or freshen your checkout.

Give this a whirl and let me know if it helps. I'll leave the issue open for now until you verify that you can get this script to run.

ptwobrussell commented 11 years ago

At this point in time, the entire repo https://github.com/ptwobrussell/Recipes-for-Mining-Twitter needs updating for Twitter v1.1 compatibility, so I'm going to close this issue because I think it may have since been resolved, but is effectively moot at this point even if it's not. Please keep an eye on the Recipes-for-Mining-Twitter repository for updates if you're interested in using that code. Thanks.