Twitter from the command line!

April 19th, 2009 § 1

While it is just as easy to go to twitter.com and update your status, it is just way freakin’ cooler to do it from the command line.  Now I will have to disappoint you Microsoft loyalists and say that this only works in Linux.  My bad.  Anyways, I take no credit for this script at all, I am just informing you of it because it doesn’t show up many places and I thought it was a pretty useful script.  The downside to this little piece of code is that you have to imbed your username and password inside the script itself, which most of the time is a bad idea, but if you’re willing to take the risk, it’s pretty damn sweet.  To do this, just paste this code into /usr/bin/twitter (which you will need to create):

1
curl --basic --user "USERNAME:PASSWORD" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json"

Obviously, you will need to replace the capitalized letters with the info required. Then you will need to make this script executable via chmod +x /usr/bin/twitter.  Now to reap the rewards.  Bust out a terminal and type in the work twitter, then write anything you want, that happens to be less that 160 characters long, and it will update your twitter account with whatever you typed after the word twitter.  You are now so much cooler than you were before that it is actually making my brain hurt but, unfortunately, as cool as this may be, it will not get you any chicks.  Enjoy!

Tagged: ,

§ Leave a Reply

What's this?

You are currently reading Twitter from the command line! at Further Down the Rabbit Hole.

meta