Created
September 24, 2015 17:23
-
-
Save alistairbill/ecbf9f52af12d45dd371 to your computer and use it in GitHub Desktop.
Simple Python script. Bulk delete tweets with their Twitter Status ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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