While the core use of Twitter is to share text-based tweets, it is now mostly crowded with fancy, and sometimes distracting, images, gifs, and even videos. If you are in a work or study environment where you want to avoid auto-playing of any loud and lurid videos and gifs, it is best to use an interface that would only display textual tweets. While there are many UI-based Twitter clients available for Ubuntu, why not use a CLI for viewing and sharing tweets from Ubuntu as it serves the purpose pretty well. Also, if you are a Terminal-savvy person, you wouldn’t want to leave the comfort of the command line and go somewhere else to do any of your daily technical activities. There is always a way to do all our stuff right inside the Terminal. So, why should tweeting be any different! Using the Terminal makes certain tasks more efficient and, even faster. The command-line tools do not use too many resources and thus form great alternatives to the widely used graphical applications, especially if you are stuck up with older hardware.
In this article, we will explain how you can Tweet directly from your Ubuntu command line through the Rainbow Stream application. The process includes installing the application, giving it access to use your Twitter account, and then tweeting from your Terminal through it.
We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS System.
Installing Rainbow Stream
Rainbow Stream is an open-source Python-based application that can be installed on Ubuntu through Python Pip3 package installer. Please follow these steps in order to install the Rainbow Stream CLI:
Open your Ubuntu command line, the Terminal, either through the Ubuntu Application Launcher search or by using the Ctrl+Alt+T shortcut.
Run the following command as sudo in order to install pip3 if your system lacks it:
$ sudo apt install python3-pip
The system might ask you the password for sudo and also provide you with a Y/n option to continue the installation. Enter Y and then hit enter; the software will be installed on your system. The process may, however, take some time depending on your Internet speed.
Now, run the following command to install the RainbowStream package through pip3:
$ sudo pip3 install rainbowstream
You might also have to install some more packages so that the Rainbow Stream utility works fine on your system. Run the following command to install some additional libraries:
$ sudo apt-get install libsqlite3-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
Enter Y on the y/n prompt and you are ready to use the Rainbow Stream CLI.
Running Rainbow Stream and Tweeting through it
Running and using Rainbow Stream is pretty simple. Run the following command to launch the Rainbow Stream CLI:
Rainbow Stream needs access permission from Twitter so that you can use the CLI client. The application now requires you to enter a PIN. In order to get this PIN, log in to Twitter through the following webpage that automatically opens in your default web browser, when you launch Rainbow Stream:
Enter your email/Twitter username and your password, and then click on the Authorize app button. Once your account information is verified, the Twitter API will generate a PIN through which you will be granted access to Rainbow Stream.
Now, enter this PIN in Rainbow Stream so that the authorization process completes and you get to the following CLI, with your Twitter username prompt:
Managing Tweets with Rainbowstream
There are several things you can do here. Entering h and then hitting Enter will display the help on all you can do at this prompt.
For example, you will be using the following command to view help on tweets:
Here, we will explain some of the common things you can do through this CLI:
1. Enter “me” and then hit Enter in order to view your own Tweets.
You can also specify the number of your Tweets you want Rainbow Stream to display:
2. Enter “home” and then hit Enter in order to view Tweets from the home stream.
You can also specify the number of Tweets you want Rainbow Stream to display:
3. Here comes the most important function of Rainbow Stream: Tweeting from the Terminal. Enter t [tweet text] and then hit Enter to tweet directly from the command line.
Now when I entered the ‘me’ command, I could see my Tweet listed in the list of my own tweets.
4. All the tweets that are listed through this utility come with an ID. You can use the ID of one of your tweets to delete it by using the following command:
If you want to quit the application, you can do so by using the Ctrl+c shortcut.
This was all you needed to know about tweeting from your Ubuntu command line. If you want to remove the utility, you can do so by running the following command:
$ sudo pip3 uninstall rainbowstream