When it comes to Twitter, there are three ways to use it: the web interface, a desktop/mobile client, or tweet from the command line (for the real Indiana Jones). The last way, despite its apparent complexity, can become very useful for people who want to reach a higher level of control over their favorite micro-blogging system. If you want to use some scripts, send your tweets automatically, or just get rid of the graphical application, TTYtter is an excellent program to start with.
The installation of TTYtter is the hardest part of the process. There are no packages released yet so the best way is to download the installation script on the official website. You will also need curl installed on your machine. On Ubuntu, use the following command to install curl.
sudo apt-get install curl
Then, you will have to rename the downloaded script to “ttytter” and make it executable. And if you like “traditional” installations, you may want to move the script to /usr/bin/. So, to sum up, you can do something like
mv ttytter.txt ttytter chmod +x ttytter sudo mv ttytter /usr/bin/.
Lastly, you can start the program by typing in your terminal:
The next step is the authentication. As you maybe know, twitter requires something called OAuth. This is why the curl package and Perl 5.8.6 or higher are needed. Start by launching TTYtter. Press Enter once, and you should see a text like that:
Request from https://api.twitter.com/oauth/request_token …. SUCCEEDED!
1. Visit, in your browser, ALL ON ONE LINE,
https://api.twitter.com/oauth/authorize?oauth_token=[random token, use yours] 2. If you are not already signed in, fill in your username and password.
3. Verify that TTYtter is the requesting application, and that its permissions
are as you expect (read your timeline, see who you follow and follow new
people, update your profile, post tweets on your behalf and access your
direct messages). IF THIS IS NOT CORRECT, PRESS CTRL-C NOW!
4. Click Authorize app.
5. A PIN will appear. Enter it below.
Follow the link given in point 1. Fill in your username, password, and grant permission to the application. It will then return a pin which you have to copy and go back to the console to paste into TTYtter. Once this is done, TTYtter will be able to fetch data from your account and display them in the terminal.
Note that sometimes you will not be able to log into twitter. You may want to check that your clock is correct, and it would be better to use NTP sync for more accuracy.
Now that the setup is done, the program should display the recent tweets from your timeline. You will notice that each tweet is of the form
code> (number of re-tweet) tweet
This strange format will help you execute the basic actions expected from a normal twitter client.
The simplest of all, just type what you want and it will be posted.
In order to display the new tweets, you can use the command
However, this will only display the unread tweets. If you want to see again the old ones, type
To reply to a tweet, use the command
/reply [code] [reply]
where code is the same used to identify the tweet in the terminal.
Notice that using just
will display the list of tweets which mentions you.
It’s even simpler than for replying:
You can perform a basic search on twitter using
So far, we’ve only seen the most basic use of TTYtter, but it can become much more if you take a look at the official page. I also invite you to take a look at the website’s FAQ and enjoy a weird sense of humor from the development team.
What do you think of TTYtter? Are you seduced by the clean, simple, yet advanced functionality? Or do you prefer to stick to the GUI? Please let us know in the comments.
Our latest tutorials delivered straight to your inbox