2009/11/15

My Twitter Python script

I know there are tons of twitter python script out there. Here is my simple python command line script to send twitter update:


import twitter, sys
api = twitter.Api()

USERNAME = 'YOUR_TWITTER_USERNAME'
PASSWORD = 'YOUR_TWITTER_PASSWORD'

api = twitter.Api(username=USERNAME, password=PASSWORD)

if len ( sys.argv ) > 1:
message = sys.argv[1]
else:
message = raw_input('Your twitter message: ')

status = api.PostUpdate( message )


You're going to need Python twitter installed, of course.