Skip to content

Instantly share code, notes, and snippets.

@alistairbill
Created September 24, 2015 17:23
Show Gist options
  • Save alistairbill/ecbf9f52af12d45dd371 to your computer and use it in GitHub Desktop.
Save alistairbill/ecbf9f52af12d45dd371 to your computer and use it in GitHub Desktop.
Simple Python script. Bulk delete tweets with their Twitter Status ID
#!/usr/bin/env python
import tweepy #https://github.com/tweepy/tweepy
# options
test_mode = False
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
access_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
deletion_count = 0
tweets_to_delete = [
# chuck your comma separated twitter ids here
]
for tweet in tweets_to_delete:
print "Deleting %d" % (tweet)
if not test_mode:
api.destroy_status(tweet)
deletion_count += 1
print "Deleted %d tweets" % (deletion_count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment