Behold the Power of the Command Line

After finding the unbelievingly cool and useful Command-line fu website, I have been consumed with finding and using powerful command line tools. Here are some of the tools I’ve been playing with recently:

xmlstarletxmlstarlet is a powerful tool set for using and manipulating XML from the command line. Anyone that interacts regularly with REST-based APIs should give this a look.

curl – I did a separate post on curl and explained how to use it to interact with the Twitter API. Things get cool fast when you start to combine these tools by piping output from one command to another. For example, using curl and xmlstarlet, you can get your Tweets from the command line (you can change the count parameter in the call to the Twitter API to get a different number of Tweets back):

curl -s -u user:password 'http://twitter.com/statuses/friends_timeline.xml?count=5' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n

festival – why read text when you can have your computer speak to you? I’m now getting my daily horoscope via curl, xmlstarlet, festival and cron:

curl -s 'http://www.trynt.com/astrology-horoscope-api/v2/?m=2&d=23' | xmlstarlet sel -t -m '//horoscope' -v 'horoscope' | festival --tts

When you’ve got tools like this, the command line is where its at!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s