A smart and nice Twitter client on terminal written in Python.

Overview

A Note about Twitter API Change

Heads-up! As Twitter discontinues supporting Stream API, RainbowStream's stream function has been stopped working for a long time. But here is a good new, from version 1.5.0 we switched to a Polling Strategy that using the home command to check for every 90 seconds. Notes that rate limit for home command itself is 15 times per 15 minutes, so don't abuse it too much to leave space for the polling stream :)

If you are interested in detail: https://github.com/orakaro/rainbowstream/issues/271

Rainbow Stream

http://img.shields.io/pypi/l/rainbowstream.svg?style=flat-square http://img.shields.io/pypi/v/rainbowstream.svg?style=flat-square

Terminal-based Twitter Client. Real-time tweetstream, compose, search, favorite, and much more fun directly from terminal.

This package is built on the Python Twitter Tools and the Twitter API, and runs on Python (2.7.x and 3.x).

Home page: https://github.com/orakaro/rainbowstream

Source code: https://github.com/orakaro/rainbowstream

Showcase

gif

Installation

The Quick Way

System Python (2.7.x or 3.x)

sudo pip install rainbowstream
# Python 3 users: sudo pip3 install rainbowstream

The Recommended Way

virtualenv

virtualenv venv
# Python 3 users : use -p to specify your Python 3 location:
# virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip install rainbowstream

Troubleshooting

Some additional libraries may need to be installed on linux.

For Debian-based distros:

sudo apt-get install python-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev

For CentOS:

sudo yum install python-devel libjpeg-devel

Mac OSX Maverick with Xcode 5.1 has a well-known clang unknown argument problem with the installation of the Pillow package—a dependency of this app. Take a look at Issue #10 and let me know if the workaround doesn't work for you.

export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

If The Quick Way doesn't work, then:

  • sudo pip uninstall rainbowstream
  • Use the The Recommended Way
  • Create an issue and provide:
    • Your OS
    • Your Python version

Usage

The Stream

Just type rainbowstream to see your stream.

You can now display tweeted images directly on the terminal! Try it with:

rainbowstream -iot # Or rainbowstream --image-on-term

Set IMAGE_ON_TERM to True in your config to to enable above feature, change IMAGE_SHIFT to set image's margin (relative to your terminal's width), and IMAGE_MAX_HEIGHT to control max height of every image (see Config Management).

You will be asked for authorization on Twitter the first time you run Rainbow Stream. Just click the "Authorize access" button, paste PIN number to the terminal, and the rainbow will start.

You might want to use Rainbow Stream with an HTTP/SOCKS proxy. Proxy settings are specified as follows:

rainbowstream --proxy-host localhost --proxy-port 1337 --proxy-type HTTP
# or the short form:
rainbowstream -ph localhost -pp 1337 -pt HTTP

Both --proxy-port and --proxy-type are optional. The default proxy port is 8080 and the default proxy type is SOCKS5.

Interactive Mode

While your personal stream is continued, you are also ready to tweet, search, reply, retweet, etc. directly from your console. Simply type h and hit the Enter key to see the help.

Input is in interactive mode. It means that you can use the arrow keys to move up and down through the history, tab-autocomplete or double-tab to view available suggestions. Input history from previous run is also available.

Read the docs for available commands.

Theme Customization

Rainbow Stream is shipped with some default themes. You can switch themes with the theme command. You can also customize themes as you please.

Theme screenshots:

  • Monokai
monokai
  • Solarized
solarized
  • Tomorrow Night
tomorrownight
  • Larapaste
larapaste

See Theme Usage and Customization for detailed information.

Bug and Feature Requests

Found a bug or a feature request? Please create an issue or contact me at @dtvd88.

Development

If you want to build a runnable version yourself, follow these simple steps:

  • Create your own Twitter Application

  • Get your Twitter application’s API key and secret

  • Create your own Pocket Application (platform: Web)

  • Get your Pocket application’s key

  • Fork this repo and git clone it

  • Create a consumer.py file in the rainbowstream directory containing:

    # Consumer information
    CONSUMER_KEY = 'APIKey' # Your Twitter application's API key
    CONSUMER_SECRET = 'APISecret' # Your Twitter application's API secret
    PCKT_CONSUMER_KEY = 'PocketAPIKey' # Your Pocket application's API key
  • Use pip to install it locally

    # cd to directory which contains setup.py (cloned directory)
    virtualenv venv # Python3 users: use -p to specify python3
    source venv/bin/activate
    pip install -e .
    which rainbowstream # /this-directory/venv/bin/rainbowstream
    # Remove ~/.rainbow_oauth if it exists
    rainbowstream # local version of rainbowstream

Contributing

I appreciate any help and support. Feel free to fork and create a pull request. You will be listed as a contributor.

License

Rainbow Stream is released under an MIT License. See LICENSE.txt for details.

Issues
  • Twitter API changes

    Twitter API changes

    We have connection problem with twitter stream API right now :( The Site Streams and User Streams endpoints have been turned off. Please migrate to alternate APIs. See https://t.co/usss

    So... is that the end for apps like this? ;c

    feature request 
    opened by xxKeith20xx 46
  • Tweeting images

    Tweeting images

    Is there a way to attach images to tweets at the moment?

    feature request 
    opened by moeviz 24
  • "Sorry, image link is broken" on all images attempted

    Every time an image is in a tweet, I get a "Sorry, image link is broken" instead of the inline image.

    config HEARTBEAT_TIMEOUT: 120 IMAGE_ON_TERM: True THEME: monokai ASCII_ART: True HIDE_PROMPT: True PREFIX: @ftw SEARCH_MAX_RECORD: 5 HOME_TWEET_NUM: 5 RETWEETS_SHOW_NUM: 5 QUOTE_FORMAT: #comment RT #owner: #tweet MESSAGES_DISPLAY: 5 TREND_MAX: 10 LIST_MAX: 5 HISTORY_FILENAME: completer.hist IMAGE_SHIFT: 2 IMAGE_MAX_HEIGHT: 90 USER_DOMAIN: userstream.twitter.com PUBLIC_DOMAIN: stream.twitter.com SITE_DOMAIN: sitestream.twitter.com

    question 
    opened by ftw37 19
  • pip3 install is missing dependencies

    pip3 install is missing dependencies

    $ sudo pip3 install rainbowstream
    Successfully installed rainbowstream python-dateutil requests pyfiglet SQLAlchemy twitter Pillow six
    Cleaning up...
    
    $ rainbowstream
    It seems that ~/.rainbow_config.json has wrong format :(
    Traceback (most recent call last):
      File "/usr/lib64/python3.3/site-packages/rainbowstream/py3patch.py", line 14, in <module>
        from HTMLParser import HTMLParser
    ImportError: No module named 'HTMLParser'
    
    $ sudo pip3 install HTMLParser 
    Successfully installed HTMLParser
    $ rainbowstream
    It seems that ~/.rainbow_config.json has wrong format :(
    Traceback (most recent call last):
      File "/usr/lib64/python3.3/site-packages/rainbowstream/py3patch.py", line 14, in <module>
        from HTMLParser import HTMLParser
      File "/usr/lib64/python3.3/site-packages/HTMLParser.py", line 11, in <module>
        import markupbase
    ImportError: No module named 'markupbase'
    
    $ fuuuuuuuuuuuuuuuu
    
    bug install error 
    opened by donpdonp 17
  • MAC 10.10.1 Error Startup.

    MAC 10.10.1 Error Startup.

    First of all thanks for the awesome work! but I got some error and I can't figure out what Im doing wrong.

    I got this problem after Ive done the virtualenv install.

    $ rainbowstream Traceback (most recent call last): File "/Users/z3roblock/venv/bin/rainbowstream", line 9, in load_entry_point('rainbowstream==1.2.5', 'console_scripts', 'rainbowstream')() File "/Users/z3roblock/venv/lib/python2.7/site-packages/pkg_resources/init.py", line 474, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Users/z3roblock/venv/lib/python2.7/site-packages/pkg_resources/init.py", line 2582, in load_entry_point return ep.load() File "/Users/z3roblock/venv/lib/python2.7/site-packages/pkg_resources/init.py", line 2265, in load return self._load() File "/Users/z3roblock/venv/lib/python2.7/site-packages/pkg_resources/init.py", line 2268, in _load module = import(self.module_name, fromlist=['name'], level=0) File "/Users/z3roblock/venv/lib/python2.7/site-packages/rainbowstream/rainbow.py", line 22, in from .draw import * File "/Users/z3roblock/venv/lib/python2.7/site-packages/rainbowstream/draw.py", line 15, in from .c_image import * File "/Users/z3roblock/venv/lib/python2.7/site-packages/rainbowstream/c_image.py", line 24, in rgb2short = call_c() File "/Users/z3roblock/venv/lib/python2.7/site-packages/rainbowstream/c_image.py", line 19, in call_c assert os.system(build + " >/dev/null 2>&1") == 0

    AssertionError

    can you help me to fix this? thanks.

    install error 
    opened by limeless 15
  • No Module named 'rainbowstream.consumer'

    No Module named 'rainbowstream.consumer'

    Hi,

    Recently I installed rainbowstream pip3 install -U rainbowstream

    Ever since, I get this error when I launch rainbowstream:

    Traceback (most recent call last): File "/usr/pip3/bin/rainbowstream", line 7, in <module> from rainbowstream.rainbow import fly File "/usr/pip3/lib/python3.6/site-packages/rainbowstream/rainbow.py", line 28, in <module> from .consumer import * ModuleNotFoundError: No module named 'rainbowstream.consumer'

    opened by jJit0 14
  • error connection to twitter

    error connection to twitter

    Get this message when trying to running rainbowstream with my own twitter API key.

    "I'm afraid we have maximum connection problem with twitter right now :( Let's try again later."

    question 
    opened by kuspoes 14
  • Error invoking rainbowstream

    Error invoking rainbowstream

    Traceback (most recent call last): File "/usr/local/bin/rainbowstream", line 5, in from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in working_set.require(requires) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: pysqlite

    install error 
    opened by JikkuJose 14
  • Cannot open .image.so

    Cannot open .image.so

    I'm runing rainbowstream at first time and i get the following error

    Traceback (most recent call last): File "/usr/bin/rainbowstream", line 9, in load_entry_point('rainbowstream==1.3.1', 'console_scripts', 'rainbowstream')() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 565, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2704, in load_entry_point return ep.load() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2377, in load return self.resolve() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2383, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "build/bdist.linux-x86_64/egg/rainbowstream/rainbow.py", line 22, in File "build/bdist.linux-x86_64/egg/rainbowstream/draw.py", line 15, in File "build/bdist.linux-x86_64/egg/rainbowstream/c_image.py", line 25, in File "build/bdist.linux-x86_64/egg/rainbowstream/c_image.py", line 21, in call_c File "/usr/lib/python2.7/ctypes/init.py", line 443, in LoadLibrary return self._dlltype(name) File "/usr/lib/python2.7/ctypes/init.py", line 365, in init self._handle = _dlopen(self._name, mode) OSError: /home/xevi/.image.so: cannot open shared object file: No such file or directory

    I'm using an Arch linux with Python3.5

    install error 
    opened by Xevib 12
  • Unable to start

    Unable to start

    OSX 10.9.4.

    Successfully installed rainbowstream python-dateutil requests six
    Cleaning up...
    

    @main ➜ ~ rainbowstream

    Traceback (most recent call last):
      File "/usr/local/bin/rainbowstream", line 5, in <module>
        from pkg_resources import load_entry_point
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
        working_set.require(__requires__)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
        raise DistributionNotFound(req)  # XXX put more info here
    pkg_resources.DistributionNotFound: Pillow
    
    install error 
    opened by guido4000 12
  • Rainbowstream Starting Error

    Rainbowstream Starting Error

    i tried everything, i still get:

    [email protected]:~ $ rainbowstream
    You are running latest version (1.5.4)
    
    There seems to be a connection problem.
    You might want to check your proxy settings (host, port and type)!
    

    any ideas ?

    opened by thonton 0
  • Rainbowstream Won't run

    Rainbowstream Won't run

    I've tried everything and just cannot get rainbowstream to run or work. I've been using this since it got created and absolutely love this thing but am at a loss in terms of what to, if it's obvious then apologies but I don't really know where to start as regards finding the problem. I've installed it via "The Recommended Way" as opposed to the quick way that also did not work. Using python3, latest version of pip, my OS is Arch Linux. Thanks, Piers.

    Traceback (most recent call last): File "/home/johnpiers/venv/bin/rainbowstream", line 5, in from rainbowstream.rainbow import fly File "/home/johnpiers/venv/lib/python3.9/site-packages/rainbowstream/rainbow.py", line 25, in from .draw import * File "/home/johnpiers/venv/lib/python3.9/site-packages/rainbowstream/draw.py", line 15, in from .c_image import * File "/home/johnpiers/venv/lib/python3.9/site-packages/rainbowstream/c_image.py", line 5, in from .py3patch import * File "/home/johnpiers/venv/lib/python3.9/site-packages/rainbowstream/py3patch.py", line 11, in unescape = HTMLParser().unescape AttributeError: 'HTMLParser' object has no attribute 'unescape'`

    opened by johnpiers 0
  • probleme since last update

    probleme since last update

    Hi, i've got a problem since last update

    `Traceback (most recent call last): File "/home/shinou/.local/bin/rainbowstream", line 5, in from rainbowstream.rainbow import fly

    File "/home/shinou/.local/lib/python3.8/site-packages/rainbowstream/rainbow.py", line 25, in from .draw import *

    File "/home/shinou/.local/lib/python3.8/site-packages/rainbowstream/draw.py", line 1139, in start_cycle()

    File "/home/shinou/.local/lib/python3.8/site-packages/rainbowstream/draw.py", line 40, in start_cycle dg['cyc'] = init_cycle()

    File "/home/shinou/.local/lib/python3.8/site-packages/rainbowstream/draw.py", line 32, in init_cycle for i in c['CYCLE_COLOR']]

    KeyError: 'CYCLE_COLOR' `

    Anyone can help me ?

    opened by Shinounet75 0
  • Update py3patch.py

    Update py3patch.py

    Remove deprecated HTMLParser.HTMLParser.unescape and replace it with html.unescape making it safer and working on Python 3.9.

    opened by poyynt 0
  • Retweets/Likes count shows 0 when the number gets too high..

    Retweets/Likes count shows 0 when the number gets too high..

    I'm not exactly sure what's going on, because this only happens sometimes.. But over half the tweets in my stream show 0 likes.. when I know they have lots. At first I thought it was because those tweets had really high numbers of likes, so maybe large numbers aren't being displayed properly due to a comma in the number, or the way twitter abbreviates high numbers now.. But I'm not so sure, cause it shows 0 for some tweets with merely a dozen likes.. while other tweets show up perfectly fine. Still I rarely see higher numbers anymore, so I'm pretty sure that's bugged in some way related to that.. Edit: Seems to be displaying more of them correctly this morning, so maybe it's an issue with Twitter's servers not sending it sometimes?

    opened by Nikorasu 0
  • Authorize failed

    Authorize failed

    Hi, after installing, when I click the ...api.twitter... link, I get this error message from Twitter.

    Whoa there! There is no request token for this page. That's the special key we need from applications asking to use your Twitter account. Please go back to the site or application that sent you here and try again; it was probably just a mistake.

    Any ideas what to do?

    opened by drikkes 0
  • Fedora 33

    Fedora 33

    Unable to install on Fedora 33 Python 3.9.0

    Tried to install as sudo, user, and in venv.

    --> rainbowstream -iot Traceback (most recent call last): File "/home/dabbill/rainbowstream/venv/bin/rainbowstream", line 5, in from rainbowstream.rainbow import fly File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/rainbow.py", line 25, in from .draw import * File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/draw.py", line 15, in from .c_image import * File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/c_image.py", line 5, in from .py3patch import * File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/py3patch.py", line 11, in unescape = HTMLParser().unescape AttributeError: 'HTMLParser' object has no attribute 'unescape'

    opened by dabbill 6
  • connects to github on first startup

    connects to github on first startup

    Why is a twitter client connecting to GitHub?

    opened by sneak 0
  • Unable to pause the stream

    Unable to pause the stream

    Expected result: The stream should pause on using the 'p' command.

    Actual result: The stream continues even after using the 'p' command.

    Steps to reproduce:

    1. Install rainbowstream through pip.
    2. Run rainbowstream.
    3. Pause stream with the 'p' command and wait until refresh timer expires.

    Environment: Fedora 32 x64, bash 5.0.17

    opened by moodyknurd 6
Releases(v1.3.7)
  • v1.3.7(Dec 11, 2016)

    • Introduce modern style of quoting by simply putting the tweet url as a quote. This allow web interface (and most clients) will then display a preview of the quoted tweet, leaving more characters available. See #197 .
    • When reply to yourself, we strip screen name to allow tweet chains. See #207
    • Limit ls() command with 300 followers/friends to avoid Rate limt exceeded. See #209
    Source code(tar.gz)
    Source code(zip)
  • v1.3.6(Oct 7, 2016)

    • Clean Build environment by @ericsagnes
    • Fix bug of not being able to filter nick in Python 3
    • Fix bug of not being able to quote in Python 2
    Source code(tar.gz)
    Source code(zip)
  • v1.3.5(Aug 17, 2016)

A smart and nice Twitter client on terminal written in Python.

A Note about Twitter API Change Heads-up! As Twitter discontinues supporting Stream API, RainbowStream's stream function has been stopped working for

orakaro.targaryen 3.3k May 31, 2021
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms INSTALLATION DESCRIPTION OPTIONS CONFIGURATION OUTPUT TEMPLATE FORMAT SELECTION

youtube-dl 95.9k Jun 5, 2021
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.

Glances - An eye on your system Summary Glances is a cross-platform monitoring tool which aims to present a large amount of monitoring information thr

Nicolas Hennion 18.5k Jun 6, 2021
:mag: Google from the terminal

googler is a power tool to Google (web, news, videos and site search) from the command-line. It shows the title, URL and abstract for each result, whi

Piña Colada 5.2k Jun 6, 2021
Linux Kernel Manager and Activity Monitor 🐧💻

Linux Kernel Manager and Activity Monitor ?? ?? The kernel is the part of the operating system that facilitates interactions between hardware and soft

Orhun Parmaksız 1.2k Jun 1, 2021
Browse Reddit from your terminal

THIS PROJECT IS NO LONGER MAINTAINED RTV Development is Shutting Down List of Alternative Projects Reddit Terminal Viewer (RTV) A text-based interface

Michael Lazar 4.5k Jun 3, 2021
:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.

Translate Shell Translate Shell (formerly Google Translate CLI) is a command-line translator powered by Google Translate (default), Bing Translator, Y

Mort Yao 5k Jun 6, 2021
Terminal-based CPU stress and monitoring utility

The Stress Terminal UI: s-tui Stress-Terminal UI, s-tui, monitors CPU temperature, frequency, power and utilization in a graphical way from the termin

Alex Manuskin 2.6k Jun 3, 2021
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 62.3k Jun 5, 2021
:duck: DuckDuckGo from the terminal

ddgr ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many

Piña Colada 2.1k Jun 5, 2021
:bookmark: Browser-independent bookmark manager

buku buku in action! Introduction buku is a powerful bookmark manager written in Python3 and SQLite3. When I started writing it, I couldn't find a fle

Piña Colada 4.5k Jun 6, 2021
Terminal based YouTube player and downloader

mps-youtube Features Search and play audio/video from YouTube Search tracks of albums by album title Search and import YouTube playlists Create and sa

null 6.7k Jun 4, 2021