All pastes #422599 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-03 15:59 UTC
rendered paste body
#!/bin/bash
# RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
#
# Usage:
# .conkyrc:     ${execi [time] /path/to/script/conky-rss.sh URI LINES TITLENUM}
#       URI = Location of feed, ex. http://www.gentoo.org/rdf/en/glsa-index.rdf
#       LINES = How many titles to display (default 5)
#       TITLENUM = How many times the title of the feed itself is specified, usually 1 or 2 (default 2)

uri=$1                                                  #URI of RSS Feed
lines=$2                                                #Number of headlines
titlenum=$3                                             #Number of extra titles

if [[ "$uri" == "" ]]; then
        echo "No URI specified, cannot continue!" >&2
        echo "Please read script for more information" >&2
else
        if [[ $lines == "" ]]; then lines=5 ; fi
        if [[ $titlenum == "" ]]; then titlenum=2 ; fi
curl -s --connect-timeout 30 "$uri" | sed -n '/<title>GLSA/s/[^(]*\([^)]*): [^ <]*\).*/\1/p' | head -10
fi