Okay, so you are a crazy BASH or Korn shell nut (DASH, ASH, TCSH, CSH, ZSH, etc., etc. yes, I mean all of you) and you totally want to be able to Tweet on your Twitter feed without going to one of those krufty GUI utilities. Such overkill for such a simple task. I feel your pain. When I found this little nugget of command line coolness I just had to share it with all of you. Special thanks to Marco Kotrotsos from Incredicorp who published this on IBM Developer Works.
If you have curl installed, all you need to do is:
curl -u username:pass -d status=”text” http://twitter.com/statuses/update.xml
So, to give you a real world example, if you are “bobtheuser” and your password is “pass1234” and you want to say “Hey, my first UNIX Shell Tweet.” then you just need to:
curl -u bobtheuser:pass1234 -d status="Hey, my first UNIX Shell Tweet." \ http://twitter.com/statuses/update.xml
You will get some feedback in the form of a response XML file. Happy Tweeting!
Disclaimer: I realize that using “Linux” in the subject is misleading. This is not a Linux specific post but will apply to FreeBSD, OpenBSD, NetBSD, Mac OSX, UNIX, Solaris, AIX, Windows with Cygwin or just about any system with a command line and the curl utility installed.
I use this as the basis for my Ruby based Twitter Client for the command line.
Thanks and glad you liked the article…