I have been using tweepy
to track tweets through given periods of time (intervals within the past 7 days of my searches), although my issue now is that when searching and storing tweets based on a highly used query search (i.e. a trending topic) tweepy sends me back an error saying the connection timed out.
Here is my code:
results = []
for tweet in tweepy.Cursor(api.search, q="trump",count=100, result_type='recent',
include_entities=True, monitor_rate_limit=True,
since="2016-05-12",until="2016-05-13", wait_on_rate_limit=True, timeout=999999).items():
results.append(tweet)
and the error:
TweepError: Failed to send request: HTTPSConnectionPool(host='api.twitter.com', port=443): Read timed out. (read timeout=60)
I have seen other posts get around this by catching the error (see similar posts here and here), although catching the error and restarting my search would involve starting all over again with my list of tweets and collecting all the tweets within my target interval (24 hrs) would be impossible because the search would restart every 15 min due to errors.
Any ideas on how to get around this?