LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Rainbow Stream – Use Twitter From the Command Line on your VPS

Twitter’s versatile platform makes it easy for people to stay up to date on the latest information and news. Did you know that Twitter’s API can be rapidly configured to integrate directly into almost any app?

Using Rainbow Stream, you can setup your VPS to view, post or read Twitter messages using the command line interface. Rainbow Stream is written in Python and as its name suggests, its main feature is the ability to display Twitter feed in a colorful fancy console.

In this tutorial, we will demonstrate how to install and operate Rainbow Stream on your Linux VPS.

 

 

Prerequisites for Installing Rainbow Stream
You will need to have installed Python and pip version 2.7.x or 3.x. In most Linux distributions, Python should already be installed on your system. It is important to verify the version of Python on your system before performing this install. To do this,type execute this command:

python –version

If Python has not been installed, you can install it using the following commands for your specific flavor of Linux.

apt-get install python (Ubuntu)
yum install python (CentOS)

Next, you will need to install python-pip package using following commands:

apt-get install python-pip (Ubuntu)
yum install python-pip (CentOS)

 

Getting Rainbow Stream Installed on your VPS
Now that you’ve satisfied the Python prerequisites, it’s time to install the Rainbow Stream Twitter client using the command line interface.
Depending on which version of Python that you have installed, you will use one of the following commands:

pip install rainbowstream (Python 2.7.x version)
pip3 install rainbowstream (Python 3. x version)

Tip: If you have difficulties, ensure that you are running this as a root or with admin privileges.
After a successful installation, you should get the below message in your terminal.

Successfully installed rainbowstream python-dateutil arrowrequests pyfiglettwitter PySocks

With the following command you will see be able to see the Rainbow Stream help guide:

rainbowstream -h

 

Connecting Rainbow Stream to the Twitter API

 

Now that the client is installed we will need to connect and authorize the application on Twitter using your Twitter account. To initiate the authorization process, simply run the following command, which will automatically pop up a web browser window for authorization:

rainbowstream

Log in with your Twitter account and hit the button that says “Authorize App”.
Copy the code presented to you in the browser window without closing it. Navigate back to the terminal and paste the PIN you just copied. Your client is now connected to your Twitter account.

Tip: If you are trying to authorize Rainbow Stream on a remote headless server, you can copy and paste the authorization URL to a web browser running on a separate computer.
Getting Started with Rainbow Stream

The “theme” command allows you to switch your Twitter timeline color theme among four of the built-in Twitter themes quickly. Just type “theme” followed by a theme name (available via tab-autocomplete).

  •   Typing the ‘home’ command will show your timeline.
  •   Typing the ‘me’ will show your last tweets.
  •   To tweet something just type ‘t’ followed by your tweet.

The most intriguing feature of Rainbow Stream is the ability to view tweet- embedded images directly in a terminal. To do this, you will need to launch rainbowstream with parameter “-iot”.

This should have you up and running with Rainbow Stream. Advanced users could setup CRON jobs to perform automated tasks. However, that is outside of the scope of this document.
Have you implemented Rainbow Stream on your VPS? Share your Rainbow Stream innovations with our user base in the comments section below.

(Tutorial was written by a contributor)

Jarland

6 Comments

  1. Good tutorial, but so many typos I think. The command to show the version of python should be ‘python –version’ instead of ‘python -version’, and there should be a space between ‘apt-get/yum’ and ‘install’.

    March 30, 2016 @ 6:49 am | Reply
    • –version, two dashes I mean.

      March 30, 2016 @ 6:50 am | Reply
    • Jarland Donnell:

      Thanks! I was hunting for word typos, completely missed the syntax typo.

      March 31, 2016 @ 12:36 am | Reply
  2. Hey Jarland, for the copy pasta folks, apt-get and yum need spaces be install python-pip. Hate to see folks have to actually type the whole command =) *cough* .bash_aliases *cough*

    April 1, 2016 @ 1:37 am | Reply
    • Sheesh…. before install python-pip. Speaking of typing =(

      April 1, 2016 @ 1:39 am | Reply
    • Jarland Donnell:

      Thanks! I swear sometimes I fix things and WordPress reverts them. Only this installation. Maybe theme/plugin related (well, I guess that should be “probably” rather than maybe).

      April 1, 2016 @ 6:20 am | Reply

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

Your email address will not be published. Required fields are marked *