After taking another look at Python I am quickly coming to love it, as an “exercise” in re-learning python I decided to write a very simple command line “tweeter” this uses the Twitter API to update your twitter status, extending from the “update twitter in a single line

You can grab a copy of the script from here: http://svn.saiweb.co.uk/branches/python/tweet.py

UPDATE 24/03/2011:Oauth version here

Example usage:

1
./tweet.py -u username -p password -t your tweet goes here

If you want to parse the JSON data normally returned after submitting a new tweet simply add the -j flag.

If you are prompted for a username and password when running this script the username and password supplied using the -u and -p flags was incorrect.

Tags: ,
3 Responses to “Making the bird tweet using python”
  1. [...] Making the bird tweet using python or Update twitter in a single line [...]

  2. Jose says:

    I have this error:
    IOError: (‘http error’, 401, ‘Unauthorized’, )

    Maybe twitter are continously changing the service?

  3. Buzz says:

    @Jose, http auth is disabled, I have provided an update in the blog post for the Oauth version https://github.com/Oneiroi/nagios_addons/blob/master/twitter/nagios_bot.py

  4.  
Leave a Reply