Skip to content

Instantly share code, notes, and snippets.

@kolen
Created March 15, 2012 08:02
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 kolen/2042843 to your computer and use it in GitHub Desktop.
Save kolen/2042843 to your computer and use it in GitHub Desktop.
Report for spam accounts with '0' name in twitter
#!/usr/bin/python
# Depends on tweepy
# easy_install tweepy
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)
api = tweepy.API(auth)
followers_ids = api.followers_ids()
print "%d followers" % len(followers_ids)
all_zeros = []
while followers_ids:
chunk_ids = followers_ids[:100]
followers_ids = followers_ids[100:]
followers = api.lookup_users(user_ids=chunk_ids)
zeros = [f for f in followers if f.name == '0']
print "Got chunk of %d followers, number of 0's: %d" % (len(chunk_ids), len(zeros))
all_zeros += zeros
for user in all_zeros:
print "Reporting for spam '%s' (%s)" % (user.name, user.screen_name)
api.report_spam(user_id=user.id)
@mahmutozerg
Copy link

do you know what is the limit of report_spam i tried several times but i couldn't find it nor detect it

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