tommeagher / heroku_ebooks

An archive of a script to generate Markov chains and to post to an _ebooks account on Twitter using Heroku. No longer actively supported.
264 stars 163 forks source link

IndexError: list index out of range #44

Closed gastypm closed 6 years ago

gastypm commented 6 years ago

I'm getting this message whenever I try to run the code. Sometimes I get "2 No, sorry, not this time." and sometimes "IndexError: list index out of range". I've read that this is cause by a less-than-3600-tweets account but the one I'm trying to source (@Tscchnnell) has more than 7k tweets.

Here's the traceback: Traceback (most recent call last): File "ebooks.py", line 135, in twitter_tweets_iter, max_id = grab_tweets(api, max_id) File "ebooks.py", line 96, in grab_tweets max_id = user_tweets[-1].id - 1 IndexError: list index out of range

tommeagher commented 6 years ago

Hey @gastypm, thanks for flagging this. Your source account was acting in an unusual manner, so I added a check to make sure the requests to twitter were actually getting any tweets. Give it a try with the new version, and please let me know if you have any other bugs.

gastypm commented 6 years ago

Thanks for the answer @tommeagher! Unfortunately I keep getting the same error message. I'll try with another account.

gastypm commented 6 years ago

I've also tried with another account (@manucaso) but I get the same error.

tommeagher commented 6 years ago

@gastypm, did you pull down the changes I made? I'm not getting any errors when I try to pull from that either of those Twitter accounts.

gastypm commented 6 years ago

Yes I did, but now I started again from the ground and it's working. Thank you!