Hi Guys, not too sure if any of you use twitter, but here's a terminal command so you can post directly to twitter from your command line or by pressing ALT+F2 and typing twitter "message" in the Run Application Box. If someone finds a use for it i'll be glad
A Twitter Command for Your Terminal
Well Twitter seems to be getting popular now, and it's pretty we documented that it can be used via the command line terminal if CURL is installed. The below is how to make a twitter command for your terminal. You will obviously need to have a Twitter account registered, and you can do that by going to this web address https://twitter.com/signup
The first thing to do is to install curl if it isn't already installed
sudo aptitude install curl
The we need to make a file which we will make executable, and store it in /usr/bin
I have used gedit but you can use any text editor you choose
sudo gedit /usr/bin/twitter
and place the following code into the newly formed file
curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null
echo Message Sent!
You will need to replace "yourusername:yourpasswd" with your twitter username and password, save the file, and exit the test editor.
Then you will need to make the file executable by placing the following code into the command line terminal
sudo chmod +x /usr/bin/twitter
To use the newly created command you can type
twitter WHATEVER YOU WANT TO POST TO TWITTER
if your using a gnome desktop, you can press ALT+F2 and in the Run Command Box that appears type
twitter WHATEVER YOU WANT TO POST TO TWITTER
Most of the above was taken from this web site http://www.ubuntu-unleashed.com/2008/03 ... ne-in.html
and all though it was used for Ubuntu it should work on nearly all distributions, remember if you change your Twitter password then you'll need to update you /usr/bin/twitter file.
I've been contacted by a few people and i have seen it myself, some messages seem to be problematic, if you have issues then try putting your text in quotes, example below
twitter "INSERT TEXT BETWEEN THE QUOTES"
// side note after writing this guide
I've noticed and it's been raised by one or two people. The script sometimes play's up, if it does try using it by putting the text between quotes like
twitter "TEXT BETWEEN QUOTES"
Finux can be found @
http://www.thelinuxsociety.org.uk
http://www.twitter.com/f1nux
irc freenode #linuxbasement





