Skip to content

Instantly share code, notes, and snippets.

@harrisony
Created September 26, 2009 10:04
Show Gist options
  • Save harrisony/194140 to your computer and use it in GitHub Desktop.
Save harrisony/194140 to your computer and use it in GitHub Desktop.
Reports twitter spammers to @spam
# wget http://python-twitter.googlecode.com/svn-history/r151/branches/hameedullah/twitter.py -O twitterwithsearch.py
import twitterwithsearch as twitter
done = []
testfile = open('spammers.txt', 'U')
for p in testfile:
done.append(p.rstrip())
username = ''
password = ''
ts = twitter.Api(username=username, password=password)
aq = ts.Search("CTX Mortgage reportedly for sale",rpp=50)
for i in aq.results:
e = i.from_user
print e
if e in done:
pass
else:
done.append(e)
e = '@'+ e
ts.PostDirectMessage("spam", e)
#TODO: Write the list of spammers reported to file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment