简体   繁体   中英

How to get one week older tweets using tweepy?

I am getting tweets from the user using twitter search api ie tweepy. I get tweets of one day but now i want to get one week older tweets. I have tried to get older tweets by this code but i am unable to get old tweets. Any help will be highly appreciated

for tweet in tweepy.Cursor(api.search,q="#afridi",count=100,\
                       lang="en",\
                       since_id=2016-05-25).items():
print tweet.created_at, tweet.text

No other way if you do not know the since_id of the tweet of just one week older tweet. To get older tweets you can let the code run for a while and check the dates of the tweets you are getting. Process those tweets as you want which are 1 week older or so. Else if you know since_id then put the since_id.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM