Jan 29

Posting to Twitter from Python

Using this minimalist Twitter API library for Python makes tweeting from code a breeze.

I found this little known Twitter API library for Python (on github). It is minimalist and very simple which I love. It's so easy to interact with the Twitter API from your Python application, that I am almost embarrassed to blog about it.

After downloading the library and putting the twitter/ directory on your Python path, this is all code you have to write to update your Twitter status:

from twitter.api import Twitter

twitter = Twitter('username','password')
twitter.statuses.update(status='I am tweeting from Python!')

Happy tweeting from Python!

Powered by my hackings on Django-Mingus a Django project, PostgreSQL, memcached, nginx, Apache + mod_wsgi, Ubuntu, Rackspace Cloud,...

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

html5 | top