Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- import tweepy
- CONSUMER_KEY = ''
- CONSUMER_SECRET = ''
- ACCESS_TOKEN = ''
- ACCESS_TOKEN_SECRET = ''
- auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
- auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
- excludes = []
- api = tweepy.API(auth, wait_on_rate_limit=True)
- ids = []
- for page in tweepy.Cursor(api.followers_ids, screen_name="CryptoCzars").pages():
- ids.extend(page)
- sleep(10)
- for id in ids:
- u = api.get_user(id)
- if u.screen_name not in excludes:
- api.create_block(id)
- sleep(0.4)
- print('blocked {}'.format(u.screen_name))
Add Comment
Please, Sign In to add comment