Archive for the 'Linux' Category

Tweet…

June 29, 2007

Ahoy! I wrote this entry because I had a few people ask me about twittering from the command line in Linux. So here ya go!

Make sure you have Curl installed… If you dont use apt-get to get it. Make a file called twitter paste the code below in it. Replace the user info with your Username and password and put your new file in/usr/local/bin, I guess you can put it where ever you want, Just remember where you put it.

Make sure it has execution permission. I used “chmod 777 twitter”. Then just type in Twitter from the command line and it will give you an imput field for your update.

Twitter uses the simplest API I’ve ever seen.

echo -n “-> “
read text
curl –basic –user “Username:Password” –data-ascii “status=`echo $text|tr ‘ ‘ ‘+’`” “http://twitter.com/statuses/update.json”