Created
January 9, 2010 07:48
-
-
Save maop/272781 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
# RandomFollowFriday.py | |
# [email protected] @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