Skip to content

Instantly share code, notes, and snippets.

@matthewfl
Created April 16, 2009 02:31
Show Gist options
  • Save matthewfl/96170 to your computer and use it in GitHub Desktop.
Save matthewfl/96170 to your computer and use it in GitHub Desktop.
A twitter Follow bot
# uses http://code.google.com/p/python-twitter/
import twitter
import time
def main():
global uesr, password
twit = twitter.Api(username=user, password= password)
twit.SetCache(None)
while 1:
try:
g = twit.GetPublicTimeline()
for u in g:
print "adding", u.user.screen_name
twit.CreateFriendship(u.user.id)
except twitter.TwitterError:
print ">>> Error <<<"
time.sleep(1000)
print "-------------------------------"
time.sleep(800) # should not be less than 10 sec
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment