Skip to content

Instantly share code, notes, and snippets.

@zaneneuschuler
Last active April 9, 2019 20:37
Show Gist options
  • Save zaneneuschuler/e22c04e38366b05321ede918cc0ae1bd to your computer and use it in GitHub Desktop.
Save zaneneuschuler/e22c04e38366b05321ede918cc0ae1bd to your computer and use it in GitHub Desktop.
Python twitter account killer. Requires a dev twitter account.
import tweepy
auth = tweepy.OAuthHandler("[YOUR CONSUMER KEY]",
"[YOUR CONSUMER SECRET]")
auth.set_access_token("[YOUR ACCESS TOKEN]",
"[YOUR ACCESS SECRET]")
api = tweepy.API(auth)
username = "[YOUR TWITTER ACCOUNT]"
public_tweets = api.user_timeline(username)
while len(public_tweets) != 20:
for tweet in public_tweets:
print(f'Deleting tweet id {tweet.id}')
api.destroy_status(tweet.id)
public_tweets = api.user_timeline(username)
for tweet in public_tweets:
print(f'Deleting tweet id {tweet.id}')
api.destroy_status(tweet.id)
print("All tweets deleted! Now unfollowing everyone...")
following = api.friends(username)
while len(following) != 0:
for account in following:
print(f'Unfollowing @{account.screen_name}')
api.destroy_friendship(account.id)
following = api.friends(username)
print("Unfollowed everyone! Now softblocking everyone...")
followers = api.followers(username)
while len(followers) != 0:
for account in followers:
print(f'Softblocking @{account.screen_name}')
api.create_block(account.id)
api.destroy_block(account.id)
followers = api.followers(username)
print("Softblocked everyone! Now exiting...")
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment