SUSHMA KUMARI
SUSHMA KUMARI

Reputation: 95

How to check the deleted tweets?

I have millions of tweet ID, I wanted to check whether the tweet is deleted or not.

I can crawl all the tweet ID using Tweepy and match it with previous data difference will be deleted tweets.

def lookup_tweets(tweet_IDs, api):
full_tweets = []
tweet_count = len(tweet_IDs)
try:
    for i in range((tweet_count//100) + 1):
        end_loc = min((i + 1) * 100, tweet_count)
        id=tweet_IDs[i * 100:end_loc]
        full_tweets.extend(api.statuses_lookup(id))
    return full_tweets
except tweepy.TweepError as e:
    print(e)
    print('Something went wrong, quitting...')

I tried to get HTTP status but it didn't work.

How can I know the tweet ID which is deleted?

Upvotes: 0

Views: 405

Answers (1)

anon
anon

Reputation:

In v1.1 of the API, Twitter returns response code 144 alongside HTTP 404 when a Tweet has been deleted.

Upvotes: 1

Related Questions