Skip to content

Instantly share code, notes, and snippets.

@b123400
Created January 18, 2016 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b123400/980bdcdb8e0705a962f2 to your computer and use it in GitHub Desktop.
Save b123400/980bdcdb8e0705a962f2 to your computer and use it in GitHub Desktop.
import tweepy
# fuck you official api key
auth = tweepy.OAuthHandler('3rJOl1ODzm9yZy63FACdg', '5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8')
auth.set_access_token('YOUR-ACCESS-TOKEN', 'YOUR-ACCESS-TOKEN-SECRET')
api = tweepy.API(auth)
def is_bad_follower(follower):
if(follower.default_profile_image and follower.lang == 'zh-cn' and follower.statuses_count < 10):
return True
return False
# followers = api.followers(screen_name='b123400', count=200)
for follower in tweepy.Cursor(api.followers,screen_name='b123400').items():
if is_bad_follower(follower) :
api.create_block(user_id=follower.id)
print('blocked',follower.screen_name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment