Tag: script
GeekTool Rss Script
by Nathan on Sep.20, 2007, under Uncategorized
Here is a little script a friend help me put together. It it basically a caching RSS reader for GeekTool. I use it to display my Netflix query on my desktop, as well as My MeeVee listing. Just change the LOG, RSS lines and it will pull the title lines out of RSS feeds. If you want more you can change the curl lines. Have fun.
-
#!/bin/sh
LOG=/Users/Nathan/scripts/netflix_queue.txt
RSS=”http://rss.netflix.com/QueueRSS?id=P1414648916102002442351662043565655″
size=$(ls -all $LOG | awk ‘{print $5}’)
if [ ! -f $LOG ]; then
curl -s $RSS | grep title | sed -E ‘s/<\/?title>//g’ > $LOG
else
age=$(echo $(date “+%s”) – $(stat -t “%s” $LOG 2>/dev/null | awk -F\” ‘{print $4}’) | bc -l)
if [ "$age" -gt 3600 -o $size = 0 ]; then
curl -s $RSS | grep title | sed -E ‘s/<\/?title>//g’ > $LOG
fi
fi
cat $LOG

