While the core use of Twitter was 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 Debian, why not use a CLI for viewing and sharing tweets from Debian 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 Debian 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.
We have run the commands and procedures mentioned in this article on a Debian 10 Buster System.
Installing Rainbow Stream
Rainbow Stream is an open source Python-based application that can be installed on Debian through Python Pip3 package installer. Please follow these steps in order to install the Rainbow Stream CLI:
Open the Terminal application by pressing the Super(Windows) key and searching for it through the Application Launcher as follows:
Login as root by entering su and then the password for root. You are now authorized to add/remove and configure software on Debian. Now, enter the following command in order to update the local repository index with that of the Internet. This helps you in installing the latest version of a software available online.
# sudo apt-get update
Run the following command as sudo in order to install pip3 if your system lacks it:
# sudo apt-get 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 Rainbow Stream 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:
In case the webpage does not open automatically, you can open it by right-clicking the link from the Terminal and then selecting Open Link from the menu.
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 CLI so that the authorization process completes and you get to the following interface, with your Twitter username prompt:
Using Rainbow Stream
There are several things you can do through the Rainbow Stream CLI. 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:
[username]: h 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:
[username]: me [num]
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:
[username]: home [num]
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:
[username]: del [number]
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 Debian command line. If you want to remove the utility, you can do so by running the following command:
$ sudo pip3 uninstall rainbowstream