Reputation: 13
I am working on a text mining project that deals with analyzing tweets.
I would like to get all tweets tweeted in english during a short period of time(not more than a day), without having the result matching to a specific search query, trend, or user criteria.
I am familiar with tweepy's api.search function. However, when i try to run it without a search query:
api.search(count=remaining_tweets, since_id=str(since_id),lang='en', max_id=str(max_id-1))
i get the following message: "exception raised, waiting 15 minutes".
Upvotes: 1
Views: 1104
Reputation: 1418
You can get all the tweet by giving *
to the query parameter:
tweets = api.search(q='*', lang='en', count=200, since_id=since_id, max_id=max_id)
If you need a specific number of tweets, you could use tweepy Cursor like this:
# Get 1000 English tweets from max_id
tweets = [tweet for tweet in tweepy.Cursor(
api.search, q='*', lang='en', count=200, max_id=max_id).items(1000)]
Upvotes: 1