Twitter command-line client
Twitter is the hottest micro-blogging platform, as well as the latest buzz of the online social media now. We can use Twitter API to read tweets on our timeline from the command line! Let us see how to do it.
Getting ready
Recently, Twitter has stopped allowing people to log in by using plain HTTP Authentication, and we must use OAuth to authenticate ourselves. A full explanation of OAuth is out of the scope of this book, so we will use a library which makes it easy to use OAuth from bash
scripts. Perform the following steps:
Download the
bash-oauth
library from https://github.com/livibetter/bash-oauth/archive/master.zip, and unzip it to any directoryGo to that directory and then inside the subdirectory
bash-oauth-master
, runmake install-all as root
.Go to https://dev.twitter.com/apps/new and register a new app. This will make it possible to use OAuth:
After registering the new app, go to your app's settings and change Access type to Read and Write:
Now, go to the...