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

keyError: 'next_results' on updated introduction__retweet_visualization.py #59

Open ez3kiel opened 11 years ago

ez3kiel commented 11 years ago

Hello Matt, im having a problem with your new script introduction__retweet_visualization.py Trying to run the script but i get an error: next_results = search_results['search_metadata']['next_results'] KeyError: 'next_results' Any idea? Thnx anyway

ptwobrussell commented 11 years ago

I think what could be happening is that what you are searching for is not returning any results, and that's causing an error. I should be handling that error case more elegantly, and will leave this ticket open as my note-to-self to do so.

Is it possible that this is what is happening? Can you share your query with me so I could try to reproduce and track down this problem?

ez3kiel commented 11 years ago

Yes, you're right!! my query is 'direngeziparkı' . i wonder why this was working with your previous script and no with the last one?


Απο: Matthew A. Russell notifications@github.com Προς: ptwobrussell/Mining-the-Social-Web Mining-the-Social-Web@noreply.github.com Κοιν.: ez3kiel giagoulas1711@yahoo.gr Στάλθηκε: 2:12 π.μ. Πέμπτη, 6 Ιουνίου 2013 Θέμα: Re: [Mining-the-Social-Web] keyError: 'next_results' on updated introduction__retweet_visualization.py (#59)

I think what could be happening is that what you are searching for is not returning any results, and that's causing an error. I should be handling that error case more elegantly, and will leave this ticket open as my note-to-self to do so. Is it possible that this is what is happening? Can you share your query with me so I could try to reproduce and track down this problem? — Reply to this email directly or view it on GitHub.

ptwobrussell commented 11 years ago

Whether or not there are results for a query is dependent entirely upon Twitter. It may be the case that they are flushing a cache or only keeping a history of the most recent tweets for a particular time window. My understanding is that query results could be transient like that.

wandeg commented 11 years ago

I'm having the same problem with the script in Chapter 1

ptwobrussell commented 11 years ago

Thanks for letting me know. I will get this patched and updated in GitHub later this morning.

On Jul 5, 2013, at 2:43 AM, wandeg notifications@github.com wrote:

I'm having the same problem with the script in Chapter 1

— Reply to this email directly or view it on GitHub.

ptwobrussell commented 11 years ago

I believe this issue is fixed in commit 16a06591aa7c9283db9ca4158eb3c40960aaaa19 - can you test it out and close this issue if you agree? I believe this is the same issue as reported in #61