Tweepy Wait_on_rate_limit Not Working
So, first off, I realize there's a number of questions regarding handling the twitter rate limits. I have no idea why, but none of the ones's I've found so far work for me. I'm us
Solution 1:
I know this might be a little late, but here goes.
You pass the wait_on_rate_limit argument in the Cursor constructor, while the tweepy documentation states that it should be passed on the API() constructor.
Solution 2:
There is a rate limit for twitter API as mentioned here: https://dev.twitter.com/rest/public/rate-limiting
The quick solution to pass this could be catching the rate limit error and sleeping your application for a while then continue where you left.
pages = tweepy.Cursor(api.followers_ids, id=followerID).pages()
whileTrue:
try:
page = pages.next()
followerIDs.extend(page)
except TweepError:
time.sleep(60 * 15)
continueexcept StopIteration:
breakshould do the trick. Not sure if this will work as you expect but the basic idea is this.
Post a Comment for "Tweepy Wait_on_rate_limit Not Working"