O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Twitter command-line client

Twitter is the hottest micro blogging platform as well as the latest buzz of online social media. Tweeting and reading tweets is fun. What if we can do both from command line? It is pretty simple to write a command-line Twitter client. Twitter has RSS feeds and hence we can make use of them. Let's see how to do it.

Getting ready

We can use cURL to authenticate and send twitter updates as well as download the RSS feed pages to parse the tweets. Just four lines of code can do it. Let's do it.

How to do it...

Let's write a Bash script using the curl command to manipulate twitter APIs:

#!/bin/bash #Filename: tweets.sh #Description: Basic twitter client USERNAME="PUT_USERNAME_HERE" PASSWORD="PUT_PASSWORD_HERE" COUNT="PUT_NO_OF_TWEETS" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required