Howto Twitter From the Command Line in Ubuntu!


Twitter rocks, here is a quick n easy way to twitter from your console in any Unix system:



sudo apt-get install curl

sudo gedit /usr/bin/twitter

Now Paste this in gEdit and simply replace "yourusername" with your username and "yourpasswd" with your twitter passwd and ctrl-s to save, then alt-F4 to exit!


curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null
echo Message Sent!


Then chmod for exec privileges:
chmod +x /usr/bin/twitter
All done! w00t! Now lets try it out :)

All you gotta do is:
twitter "message here without the quotes"
You dont even need to open the command line, all you gotta do is press alt-F2 and type twitter then your message, and dont forget to check "Run in Terminal"

Clicky Web Analytics