Linux Apps
Now Reading
How to install Rainbow Stream – An advanced Command line Twitter Client
0

How to install Rainbow Stream – An advanced Command line Twitter Client

Install Rainbow Stream – An advanced Command line Twitter Client

Rainbow Stream is an open source Twitter-client for Linux, written in Python. It displays the Realtime tweetstream, searches, images, favorites, compose a tweets etc. Installation of Rainbow stream is explained in this article.

Features

  •  Free and open source Twitter-client for Linux command-line.
  • Capable of rendering twitter image in Terminal.
  • Well implemented Theme Customization.
  • Support Proxy.
  • Interactive Mode supported.
  • We can tweet, search, favorite tweets right from your terminal.

To Install Rainbow Stream Twitter Client in Linux

Check the version of Python.

root@linuxhelp:~# python --version
Python 2.7.10

Update the repositories by using the following command.

root@linuxhelp:~# apt-get update
Hit http://in.archive.ubuntu.com wily InRelease
Get:1 http://security.ubuntu.com wily-security InRelease [65.9 kB]
Get:2 http://in.archive.ubuntu.com wily-updates InRelease [65.9 kB]            
Get:3 http://in.archive.ubuntu.com wily-backports InRelease [65.9 kB]          
Get:4 http://security.ubuntu.com wily-security/main Sources [51.4 kB]          
Get:5 http://security.ubuntu.com wily-security/restricted Sources [2,854 B]
.
.
.
Get:48 http://security.ubuntu.com wily-security/main Translation-en [79.4 kB]  
Get:49 http://security.ubuntu.com wily-security/multiverse Translation-en [2,806 B]
Get:50 http://security.ubuntu.com wily-security/restricted Translation-en [2,666 B]
Get:51 http://security.ubuntu.com wily-security/universe Translation-en [35.4 kB]
Fetched 1,850 kB in 1min 12s (25.4 kB/s)                                       
Reading package lists... Done

To install python-pip package use the following command.
On CentOS

# yum install python-pip

On Debian 

root@linuxhelp:~# apt-get install python-pip -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
  libdbus-1-dev libjs-jquery libruby2.1 libyaml-0-2 ruby2.1
  rubygems-integration
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  python-colorama python-distlib python-ndg-httpsclient python-requests
  python-setuptools python-urllib3 python-wheel
.
.
.
Setting up python-distlib (0.2.1-1) ...
Setting up python-ndg-httpsclient (0.4.0-1) ...
Setting up python-urllib3 (1.11-1) ...
Setting up python-requests (2.7.0-3) ...
Setting up python-setuptools (18.4-1) ...
Setting up python-pip (1.5.6-7ubuntu1.2) ...
Setting up python-wheel (0.26.0-1) ...

Important: Using “dnf” in place of yum, if you are on Fedora 22.

To install rainbow stream twitter client.

root@linuxhelp:~# pip install rainbowstream
Downloading/unpacking rainbowstream
  Downloading rainbowstream-1.3.3.tar.gz (46kB): 46kB downloaded
  Running setup.py (path:/tmp/pip-build-cj7Ht4/rainbowstream/setup.py) egg_info for package rainbowstream
    
Downloading/unpacking python-dateutil (from rainbowstream)
  Downloading python_dateutil-2.5.3-py2.py3-none-any.whl (201kB): 201kB downloaded
Downloading/unpacking arrow (from rainbowstream)
  Downloading arrow-0.8.0.tar.gz (81kB): 81kB downloaded
.
.
.
  Found existing installation: requests 2.7.0
    Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
  Running setup.py install for pyfiglet
    
    Installing pyfiglet script to /usr/local/bin
  Running setup.py install for PySocks
    
Successfully installed rainbowstream python-dateutil arrow requests pyfiglet twitter PySocks
Cleaning up...

Rainbow Stream Twitter Client Usage

Using your twitter account, you have to connect and authorize application on twitter site.
Type “rainbowstream” in your Linux terminal.

root@linuxhelp:~# rainbowstream
You are running latest version (1.3.3)

Hi there! We're gonna get you all set up to use Rainbow Stream.

In the web browser window that opens please choose to Allow
access. Copy the PIN number that appears on the next page and paste or
type it here:

Opening: https://api.twitter.com/oauth/authorize?oauth_token=d7HtrgAAAAAAXZ0wAAABVXyWuJc


(process:30856): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Please enter the PIN:

It will open the twitter login page on your default web browser.
snap 1
Login with the PIN number.
snap 2

If you configured more than one account in your HTTP, try to log out of other account and login to the account you need to connect. Copy PIN from HTTP web Browser into your terminal and click Enter key.

Please enter the PIN: 8624664

That's it! Your authorization keys have been written to /home/user1/.rainbow_oauth.
 _            _                       _ _                  
| |          | |                     | (_)                 
| |_ ___  ___| |_ _   _ ___  ___ _ __| |_ _ __  _   ___  __
| __/ _ \/ __| __| | | / __|/ _ \ '__| | | '_ \| | | \ \/ /
| ||  __/\__ \ |_| |_| \__ \  __/ |  | | | | | | |_| |>  < 
 \__\___||___/\__|\__,_|___/\___|_|  |_|_|_| |_|\__,_/_/\_\
                                                           
                                                           

Need tips ? Type "h" and hit Enter key!
[@testuserlinux]:

In Twitter stream, you can see tweets those you follow.


[@testuserlinux]: 
  Saina Nehwal @NSaina 2016/06/23 15:02:39 
  ₪:0 ♥:0 id:0 via Twitter for iPhone 
  Thank u shahid ☺️👏👏👍 https://twitter.com/shahidkapoor/status/745891535384883200

[@testuserlinux]: 
  Blood Donors India @BloodDonorsIn 2016/06/23 15:06:19 
  ₪:0 ♥:0 id:1 via Twitter for Android 
  #Mumbai A+ve for 6 yr old Sameer at KEM hospital, Mumbai. please contact his uncle Jailur 8976931929

  TIMES NOW @TimesNow 2016/06/23 15:06:31 
  ₪:0 ♥:0 id:2 via TweetDeck 
  Pak & India should be included in NSG at the same time, similar to their inclusion in SCO: Pak President to Chinese President Xi #MissionNSG
1466674593026	addons.update-checker	WARN	Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
1466674593259	addons.update-checker	WARN	Update manifest for ubufox@ubuntu.com did not contain an updates property

  COLORS @ColorsTV 2016/06/23 15:06:43 
  ₪:0 ♥:0 id:3 via TweetDeck 
  RT @Hussainkk12: And that's called "Havin a Blast " #Throwback #kkkoncolors @MeiyangChang n me attached to d helicopter https://t.co/WZlvzsc9hC

To Display the current twitter Trend

[@testuserlinux]: trend
#iVoted: http://twitter.com/search?q=%23iVoted
#短冊に願いを込めて: http://twitter.com/search?q=%23%E7%9F%AD%E5%86%8A%E3%81%AB%E9%A1%98%E3%81%84%E3%82%92%E8%BE%BC%E3%82%81%E3%81%A6
#FelizJueves: http://twitter.com/search?q=%23FelizJueves
#BrexitOrNot: http://twitter.com/search?q=%23BrexitOrNot
#dogsatpollingstations: http://twitter.com/search?q=%23dogsatpollingstations
舞台化: http://twitter.com/search?q=%E8%88%9E%E5%8F%B0%E5%8C%96
ボスドロ: http://twitter.com/search?q=%E3%83%9C%E3%82%B9%E3%83%89%E3%83%AD
伽羅ちゃん: http://twitter.com/search?q=%E4%BC%BD%E7%BE%85%E3%81%A1%E3%82%83%E3%82%93
ボスマス: http://twitter.com/search?q=%E3%83%9C%E3%82%B9%E3%83%9E%E3%82%B9
Metro Turizm: http://twitter.com/search?q=%22Metro+Turizm%22

To view current twitter trend country-wise

Run the following command to view the trend country-wise.

[@testuserlinux]: trend IN
#RIPpassword: http://twitter.com/search?q=%23RIPpassword
#FlipkartFashionWeekend: http://twitter.com/search?q=%23FlipkartFashionWeekend
#NextNow: http://twitter.com/search?q=%23NextNow
#PsychoRamanTrivia: http://twitter.com/search?q=%23PsychoRamanTrivia
Gurudas Kamat: http://twitter.com/search?q=%22Gurudas+Kamat%22
#CrazyHairRemedies: http://twitter.com/search?q=%23CrazyHairRemedies
Jamie Vardy: http://twitter.com/search?q=%22Jamie+Vardy%22
Lolab: http://twitter.com/search?q=Lolab
Paul Scholes: http://twitter.com/search?q=%22Paul+Scholes%22
Saritha Nair: http://twitter.com/search?q=%22Saritha+Nair%22

To view your twitter Home and Followers, run the following command.

[@testuserlinux]: home
Humanized date display method does not support your $LC_ALL.
[@testuserlinux]: ls fl
All: 6 followers.
  MEGHA GUPTA @reviewndwriteup 
  Noemi George @noemigeorge6361 
  Ann Rosa @AnnAnnrosa2637 
  Nora Kline @norakline2754 
  Bobbi Roy @Bobbiroy4726Roy 
  Anuj Goel @anuj_goel1

Use the following command to see the list of all your friends, people whom you are following.

[@testuserlinux]: ls fr
All: 100 friends.
  Gutta Jwala @Guttajwala 
  Akshay Kumar @akshaykumar 
  MIB India @MIB_India 
  Saina Nehwal @NSaina 
  G.V.Prakash Kumar @gvprakash 
  FoodFood @FoodFood 
  ਦੇਸੀ ROCKSTAR @igippygrewal 
  9XM @9xmHaqSe 
  Blood Donors India @BloodDonorsIn 
  Sunburn Festival @SunburnFestival 
  Virat Kohli @imVkohli 
  Virender Sehwag @virendersehwag 
  SAB TV @sabtv 
  MTV India @MTVIndia 
  BOHEMIA @iambohemia 
  Star Sports @StarSportsIndia 
  Dhanush @dhanushkraja 
  ADG PI - INDIAN ARMY @adgpi 
  Anita Dongre @anitadongre 
  Smriti Z Irani @smritiirani 
  INC India @INCIndia 
  Vh1 Supersonic @Vh1Supersonic 
  Amit Shah @AmitShah 
  Samantha Ruth Prabhu @Samanthaprabhu2 
  BCCI @BCCI 
  Yogeshwar Dutt @DuttYogi 
  Rohit Sharma @ImRo45

The list of commands you will execute to handle your twitter tweets.

Command:                    Description:

h                           help
p                           To pause Twitter Stream
r                           To resume Twitter Stream
c                           Clear Screen
v                           Version for Twitter Client
q                           To Quit Rainbow Stream
theme                       To list available theme
theme Name-of-theme         To apply the theme
notification                To see notification
whois @testuserlinux        To view profile
mentions                    To show mentions timeline
view @ testuserlinux        To view timeline
s string                    To search for a string
inbox                       To show inbox 
fl @twitter_user            To follow a person
ufl @twitter_user           To unfollow a person
block @twitter_user          To block a person
unblock @twitter_user        To unblock a person
report @twitter_user         To report about a account
List home                    To show timeline of list   

To view tweets for a particular community or any person


[@testuserlinux]: switch public #cricket
           _      _        _   
          (_)    | |      | |  
  ___ _ __ _  ___| | _____| |_ 
 / __| '__| |/ __| |/ / _ \ __|
| (__| |  | | (__|   <  __/ |_ 
 \___|_|  |_|\___|_|\_\___|\__|
                               
                               


  bhaveshgorsia @bhaveshgorsia 2016/06/23 15:23:25 
  ₪:0 ♥:0 id:0 via Twitter Web Client 
  @OruasCricket yeah shouldn't be forgotten the main aim for the division cricket is to get more time for domestic T20 games.

  Shreya @ReallyShrey 2016/06/23 15:23:25 
  ₪:0 ♥:0 id:1 via Twitter for Android 
  Have you ever tried Cricket? https://twitter.com/NiallOfficial/status/745912358162276356

  A. Ghaffar Dawn News @SportsReporter_ 2016/06/23 15:23:25 
  ₪:0 ♥:0 id:2 via Twitter for Android 
  Hard to say if even 4 Pakistan journalist able to attend tour.Pakistan need home Cricket.Pakistan suffers. https://twitter.com/ajarrodkimber/status/745915813442486272

  Jameshubert  @ImJames_ 2016/06/23 15:23:26 
  ₪:0 ♥:0 id:3 via Twitter for iPhone 
  RT @bhogleharsha: Indian cricket is lucky to have two fine Indian candidates who are keen to coach the national team. It is a good sign.

  aaku srivastava @aakusrivastava 2016/06/23 15:23:29 
  ₪:0 ♥:0 id:4 via Twitter Web Client 
  RT @ianuragthakur: Thanks for coming @ShekharGupta, lovely talking to you at HPCA Cricket Stadium Dharamshala. https://t.co/zw0j3pSD2L

To display ouput like echo command.

[@testuserlinux]: random_rainbow('This is rainbow stream twitter client')
This is rainbow stream twitter client

To quit the page.

[@testuserlinux]: q
See you next time :)

To get help for rainbowstream command.

root@linuxhelp:~# rainbowstream -h
usage: rainbowstream [-h] [-s STREAM] [-to TIMEOUT] [-tt TRACK_KEYWORDS]
                     [-fil FILTER] [-ig IGNORE] [-iot] [-24] [-ph PROXY_HOST]
                     [-pp PROXY_PORT] [-pt PROXY_TYPE]

optional arguments:
  -h, --help            show this help message and exit
  -s STREAM, --stream STREAM
                        Default stream after program start. (Default: mine)
  -to TIMEOUT, --timeout TIMEOUT
                        Timeout for the stream (seconds).
  -tt TRACK_KEYWORDS, --track-keywords TRACK_KEYWORDS
                        Search the stream for specific text.
  -fil FILTER, --filter FILTER
                        Filter specific screen_name.
  -ig IGNORE, --ignore IGNORE
                        Ignore specific screen_name.
  -iot, --image-on-term
                        Display all image on terminal.
  -24, --color-24bit    Display images using 24bit color codes.
  -ph PROXY_HOST, --proxy-host PROXY_HOST
                        Use HTTP/SOCKS proxy for network connections.
  -pp PROXY_PORT, --proxy-port PROXY_PORT
                        HTTP/SOCKS proxy port (Default: 8080).
  -pt PROXY_TYPE, --proxy-type PROXY_TYPE
                        Proxy type (HTTP, SOCKS4, SOCKS5; Default: SOCKS5).

Thank you! for using Linux Help.

You find this tutorial helpful? Share with your friends to keep it alive.

For more help topics browse our website www.linuxhelp.com

Be the first to comment, we value your suggestions. For further queries please comment below.

Leave a Response