April 26, 2008

twittering

Ok so I signed up for twitter a while ago, Jan 2008 I think. I haven't used it a whole bunch mainly because I had to login via browser to make a tweet. Currently I don't subscribe to a SMS service (no crackberry issued by work yet) so this is out of the picture in my case.

Using the Blog It tool on facebook though got me back into tweeting a bit. However, even better than than is putting this service at my finger tips where I am 1/2 of the day or more anyway. A command shell.

The API for this service is quite simple. And a quick google search and you have more than enough info on how to tweet right from your shell. Here is my quick script.

#!/bin/bash
#
CURL=/usr/bin/curl
USER=user
PASS=pass

$CURL --basic --user "$USER:$PASS" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" > /dev/null

This is 100% better than logging in to twitter from a browser. Now I can tweet without hassle.