7 Dec 2009, 9:34pm
Linux mac os x:
by

1 comment

Updating Your Twitter Status with cURL and a Bash Function

I’m usually at the command line so I wrote a little a bash function so that i can type

tweet this is really neat but kind of pointless

and it will update my twitter status! some characters trip it up but in general it’s useful for most of my tweets. The tweet function just spits out the arguments passed to it for the status parameter for the API call to twitter.

Add the following to the .bash_profile file and reload the terminal (don’t forget to add your email and pwd where appropriate).

tweet() {
   curl -u your_twitter_email_addr:your_twitter_passwd -d status="$*" http://twitter.com/statuses/update.xml
 }
 

*** Twitter still uses http basic authentication for their API. However, they are moving away from it in favor of oAuth. So I’m not sure how long this fun will last :{