I am currently using Tweepy library, and I launched it since several days. However after a while, I received the following message between each tweet collected:
HTTP Error 429: Too Many Requests
Service not available
wait_on_rate_limit
streamer = tweepy.Stream(auth=api.auth, listener=StreamListener(), timeout=3000000000)
streamer.filter(None,terms)
class StreamListener(tweepy.StreamListener):
status_wrapper = TextWrapper(width=60, initial_indent=' ', subsequent_indent=' ')
def on_status(self, status):
print ('{} {} - {}'.format(status.author.screen_name, status.created_at,status.text))
saveTweet(status)
def on_disconnect(self, notice):
print ("Disconnect: {}".format(notice))
return
def on_warning(self, notice):
print ("Warning: {}".format(notice))
return
def on_exception(self, exception):
print ("Exception: ".format(exception))
return
def on_error(self, status_code):
if (status_code == 403):
print("Limit probably reached")
else:
print("Error occured > {}".format(status_code))
return False
Hi!
For those who have the same issue, just upgrade Tweepy ! I raised an issue on the Github's Tweepy project, and it has been solved. Please see issue #791 for more information