Search code examples
pythontweepy

Tweepy not unretweeting Tweets from over a month ago


I have the following code, which goes through my user timeline and cleans it up by Unretweeting all the Retweets. The problem is that when I reach Tweets over a month ago, it doesn't Unretweet them, so how do I solve this?

for tweet in tweepy.Cursor(api.user_timeline, tweet_mode = 'extended').items(3200):
    
    status = api.get_status(tweet.id)

    if status.retweeted == True or tweet.full_text.startswith('RT @'):
        api.unretweet(tweet.id)
        print('Tweet has been Unretweeted.\n')

Solution

  • I changed the api.unretweet(tweet.id) to api.destroy_status(status.id).