Use Twitter from the command line on Ubuntu bash for Windows

I read this (“Using Twitter From the Command Line Is Actually Really Fun“) and I wanted it too. Not in an ordinary Linux box but in the Ubuntu bash on Windows 10. Turned out that I needed to add a graphical browser to be able to log into Twitter and authenticate the Rainbow Stream app.

It isn’t hard to do, but I thought I’d write it down anyway.

Assuming that bash is already installed, run these commands. There will be lots of notices and messages…

  1. sudo apt-get install python3-pip (skip this if you already have pip; it is only required for the third step)
  2. sudo apt-get install libsqlite3-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
  3. sudo pip3 install rainbowstream
  4. sudo apt-get install firefox (or any other web browser)
  5. in Windows, install an X server. I followed this article and installed the Xming X Server for Windows.
  6. back in bash: export DISPLAY=:0
  7. firefox & (should open FF in an X window)

Hit enter to return to the prompt.

Now run rainbowstream and authenticate the app in the browser. Enter the pin Twitter returns into rainbowstream and it should be up and running.