Use twitter from the terminal!
March 20th, 2009
Today I decided that I’m going to give twitter another try, but the first thing that struck me was how cumbersome it was to actually post a tweet.
The way I did it:
- Open your favourite browser
- Go to twitter.com
- Log in
- Write a tweet
I’m a Linux user and I love the terminal. Wouldn’t it be better to write tweets from the terminal? – Yes it would!
I have written a quick and dirty python script that enables you to write tweets from the terminal.
You can download the script here.
Install guide for Debian:
Step 1: Download
$ wget http://dibon.net/tweet
$ chmod +x tweet
$ sudo mv tweet /usr/bin/
Step 2: Install curl
The script uses curl to send data to twitter, if you don’t have curl installed you have to install it:
$ sudo aptitude install curl
Step 3: Make the config
Make a file called “.tweet” in your home directory:
$ vim .tweet
And insert the following:
[login]
username = YOURUSERNAME
password = YOURPASSWORD
You may want to edit the permissions for the file
$ chmod 0700 .tweet
That’s about it. You may have you reopen your terminal window before you can use the tweet command.
Usage:
$ tweet "I'm writing a tweet in terminal!"
Unfortunately it is necessary to use single or double quotes before and after the message.
March 21st, 2009 at 14:01:57
If you want a more full-fledged client (being able to read replies, etc), http://twitter.rubyforge.org/ is a good alternative. It even uses a SQLite db as a backend.
March 21st, 2009 at 14:50:29
Thanks for the comment and tip Bjørn. Looks good, I will try it out!