
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"

You do have to include the quotes when you type characters like parenthesis. Dunno what else need this. ? and ; don't.
ReplyDeleteWhy would you want to tweet from CLI?
ReplyDeleteI'm being smart, but not, with that statement. I mean, Twitter can be used from Fx, the website, your mobile, via email...
I won't say it's pointless, because I use some pretty niche products, but it does seem odd to me.
Still, glad to see more tips.
well sometime I personally dont have a window manager running, and I spend allot of time on the terminal so it is convenient for me, and probably others that use twitter and use the command line allot.
ReplyDeletekyle - I could see that, that's why I didn't want to call it "pointless". ;)
ReplyDeleteHey, if it works for one person, then it's worth it. I just use the CLI for maintenance, so it doesn't relate to me personally.
Mike, yes, africans do use ubuntu, afterall ubuntu is a african word meaning:
ReplyDeleteA Zulu word, literally meaning “humanness.” Ubuntu is a social and spiritual philosophy serving as a framework for African society.
I hope your not being racist, which I think you are, I will forgive you for that this time. I am not african but I have some beloved friends that are that use the command line daily, some that I know and I learn allot from, and then learning to adapt and deal with racism means that the racists have allot to learn from them as well.
Waiting for your next post -- you seem to be on holiday.
ReplyDeleteI'm waiting too...
ReplyDeleteEverything works fine until the line
ReplyDeletechmod +x /usr/bin/twitter
then it says
chmod: changing permissions of '/usr/bin/twitter': not permitted
Any tips?
I think he forgot to put "sudo" in front of that command.
ReplyDeleteyeah thanks dirtvoyles. :)
ReplyDeleteDoesn't say sudo there, but I guess they expect people to assume that part of it.
I got this idea from fsckn w/linux, and improved his idea with echo message sent and output to dev/null, and added twittering from alt F2
ReplyDelete