Guest User

Untitled

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. from time import sleep
  2. import tweepy
  3.  
  4. CONSUMER_KEY = ''
  5. CONSUMER_SECRET = ''
  6. ACCESS_TOKEN = ''
  7. ACCESS_TOKEN_SECRET = ''
  8.  
  9. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  10. auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
  11.  
  12. excludes = []
  13.  
  14. api = tweepy.API(auth, wait_on_rate_limit=True)
  15.  
  16. ids = []
  17. for page in tweepy.Cursor(api.followers_ids, screen_name="CryptoCzars").pages():
  18. ids.extend(page)
  19. sleep(10)
  20.  
  21. for id in ids:
  22. u = api.get_user(id)
  23. if u.screen_name not in excludes:
  24. api.create_block(id)
  25. sleep(0.4)
  26. print('blocked {}'.format(u.screen_name))
Add Comment
Please, Sign In to add comment