(1) install python-twitter-tools
(2) Register an app with twitter to get oath credentials
(3) Run this code ftw!
(4) You'll need to set those four variables to the ones you got in step 2 for this to work of course
python-twitter-tools has the most natural twitter API I've seen. It's really beautiful. The namespace follows the restful API urls, so you don't need any documentation other than what's on the twitter dev website. It really does Just Work.
import twitter
if __name__ == "__main__":
oa = twitter.oauth.OAuth(access_key, access_secret, consumer_key, consumer_secret)
tw = twitter.Twitter(auth=oa)
followers = tw.statuses.followers()
print "You have", len(followers), "followers"
for f in followers:
print f['name']
Sunday, January 23, 2011
Subscribe to:
Post Comments (Atom)
3 comments:
Nice find, it works great and is much simpler to install than everything else I've tried. Just Python and setuptools.
To me the command to actually Tweet wasn't obvious, it's done like this: twitter set
Thanks for the comment -- glad to know someone else is using the goodness :)
Cheers!
Hey guys let's share this in our own twitter wall.
Post a Comment