Watch Digg RSS Headlines From Terminal


Wouldn’t it be nice if you could just watch rss headline from digg (or any website) by just typing “digg” in your terminal?

Like this:

2007-12-03-121130_1280x800_scrot

I used this shell script to achieve this:

#!/bin/sh
if [ $# -eq 1 ] ; then
headarg=$(( $1 * 2 )) # $(( )) specifies that you’re using an equation
else
headarg=”-20″ # default is four headlines
fi

curl –silent “http://digg.com/rss/index.xml” | grep -E ‘(title>)’ | \
sed -n ‘4,$p’ | \
sed -e ’s/<title>//’ -e ’s/<\/title>//’|\
head $headarg

2007-12-03-121150_1280x800_scrot

You can replace the digg rss feed url with any other website feed you want. Than just alias the word “digg” to the shell script to execute the script by typing “digg” alias digg=”sh rss.sh” or any words of your choice.

In case of digg you can even have customized rss feed with certain keyword from it’s search result: http://digg.com/search




Subscribe without commenting


Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.