Skip to content

Instantly share code, notes, and snippets.

@Fluepke
Created February 12, 2022 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fluepke/d588cd7262cc2468568cacdb9e7a1367 to your computer and use it in GitHub Desktop.
Save Fluepke/d588cd7262cc2468568cacdb9e7a1367 to your computer and use it in GitHub Desktop.
Nuke followers of a Twitter account
#!/bin/env python
import tweepy
import sys
from tqdm import tqdm
print(f"Nuking {sys.argv[1]}")
consumer_key = '<redacted>'
consumer_secret = '<redacted>'
access_token = '<redacted>'
access_token_secret = '<redacted>'
allow_list = [ '<redacted, *sigh*>']
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
for i in tqdm(tweepy.Cursor(api.get_follower_ids, screen_name=sys.argv[1]).items()):
if str(i) in allow_list:
continue
api.create_block(user_id = i)
print('Blocking done')
@Fluepke
Copy link
Author

Fluepke commented Feb 12, 2022

Get required tokens and secrets from https://developer.twitter.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment