Twitter + shell for Python

In response to this post, I’ve written an equivalent script in python (because I’m too lazy to get the CPAN lib):

#!/usr/bin/python

from twyt.twitter import Twitter
import sys

username = ''
password = ''

def tweet(message):
    twitter = Twitter()
    twitter.setauth(username, password)
    twitter.status_update(message)

if __name__ == '__main__':
    message = ' '.join(sys.argv[1:])
    tweet(message)

It depends on python-twyt. Enjoy!

Share and Enjoy:
  • Facebook
  • StumbleUpon
  • Twitter

If you enjoyed this post, you might also like...


 
 
 

Leave a Reply

CommentLuv Enabled