I have the following code in Python:
import tweepy
consumer_key = "..."
consumer_secret = "..."
access_token = "..."
access_token_secret = "..."
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
start_date = datetime.datetime(2018, 1, 19, 12, 00, 00)
end_date = datetime.datetime(2018, 1, 19, 13, 00, 00)
api = tweepy.API(auth)
for tweet in tweepy.Cursor(api.user_timeline, screen_name="@IBM", since=start_date, until=end_date).items():
print("ID TWEET: " + str(tweet.id))
Is there a way to get tweets between start_date
and end_date
, by modifying the cursor with tweepy?
I have already tried to use the since=
and until=
parameters, but they have not worked.
Thank you in advance.