Created
April 16, 2009 02:31
-
-
Save matthewfl/96170 to your computer and use it in GitHub Desktop.
A twitter Follow bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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