Hi all,
So I am extremely knew to all of this, I am using my twitter account as a target to try and practice my skills with python. The first thing I am trying to do is delete old tweets past a certain age by pulling the tweet id from my archive and using api.destroy_status to delete it. The problem that I am encountering is a 144 error, even though I can check the index.html file and trace that tweet and see it. This happened for 99% of the 5k+ tweets in the archive. There were 15 that were “deleted” but after checking my profile the number of tweets hasn’t changed at all. The bulk of what i’m doing can be shown here:
file_reader = open(‘tweets.csv’, newline = ‘’, encoding=‘utf-8’)
read = csv.DictReader(file_reader)
count = 0
for row in read:
tweet_id = int(row[‘tweet_id’])
tweet_date = parse(row[‘timestamp’],ignoretz = True).date()
if tweet_date >= parse(date).date():
continue
try:
print(‘Deleting tweet #{0} from {1}’.format(tweet_id,tweet_date))
api.destroy_status(tweet_id)
count += 1
time.sleep(0.5)
except(tweepy.TweepError) as err:
print(‘Exception: %s’ % err.reason)
pass
print(‘Total Number of tweets deleted: %s\n’ % count)
Is there something obvious I’m missing? Any insight would be greatly appreciated.
Thanks.