Skip to content

Instantly share code, notes, and snippets.

@maop
Created January 9, 2010 07:48
Show Gist options
  • Save maop/272781 to your computer and use it in GitHub Desktop.
Save maop/272781 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# RandomFollowFriday.py
# me@marcoalfonso.net @maop
# You have to use this patch: http://python-twitter.googlecode.com/issues/attachment?aid=6509573335595538436&name=friends-followers-cursor.patch
# Since current twitter.py does not paging right (http://code.google.com/p/python-twitter/issues/detail?id=113)
import twitter
import random
USERNAME = "XXXXXX"
PASSWD= "xxxxxxxxxxxxxxxxx"
api = twitter.Api(username=USERNAME, password=PASSWD)
f = api.GetFollowers() #change to GetFriends() if you wish so
followers = [u.screen_name for u in f]
ff = "Random #FollowFriday: "
for i in range(10):
ff = ff + "@%s " % random.choice(followers)
status = api.PostUpdate(ff)
if status:
print "FF Posted: %s" % ff
else:
print "An Error Ocurred"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment