Monday, March 8, 2010

How to use twitter from the terminal

I consider Twitter a fairly useful and funny way to share and get information. I don’t belong to the horde of people who sanctify Twitter like the Deep Thought of The Hitchhiker's Guide to the Galaxy. I wish them to get their 42 at some point of their savant blabbing about the wonders of this web 2.O icon.

I used to twitter from the web page but I soon got tired of it because it was uncomfortable to switch back and forth to the twitter tab. A better way is using a dedicated widget like twitdeck which is a fancy Adobe Air program that organizes all your twits, contacts and personal messages. Twitdeck does the job but it sometimes makes my fan spin a bit too much for my taste.

I knew that Twitter API were available and thus I googled to find some Linux native Twitter clients. Imagine my surprise when I stumbled upon Twyt.

Twyt is a Python Twitter client, written by Andrew Price and based on classes of the afore mentioned Twitter API. It allows to do almost everything you can do from the web client or some other fancy widgets, but from the terminal.

If you have Ubuntu, like me, you will find the python-twyt package on the repositories. Otherwise you need to download Twyt from here, unpack it with tar -xvf twyt-0.2.2.tar.gz and install with ./setup.py install. Should you have problems running it at first shot try install python and python-simplejson to saftisfy the dependencies.

The most basic command is tweet[options]. Thus after having completed the installation open a terminal like bash and type:



-u is the option needed to specify the username that in my case is followed by wizandchips

You will then prompted to insert your password  and the magic's done. You can specify the password with -p but the author does well to discourage this practice on the command line. You could instead save the password for the session using the command twyt user -u USERNAME -p PASSWORD set. This is at least the method from version 0.9.0. I've got the 0.9.2 installed and for me I had to close bash and open it up again because otherwise I god a bad user/password message at every tweet attempt.



Twyt offers several other commands to delete status messages by ID with delete [options] id, to show the latest public messages (max 20) with publictl [options], show your friends messages (max 20) with friendstl [options] [username], show your messages with usertl [options] [username], and so on.
You can find the detail of all the commands for the client reading the manual through bash by typing man twyt.

Twyt is released under the BSD license

No comments:

Post a Comment