All pastes #71383 Raw Edit

chi

public text v1 · immutable
#71383 ·published 2006-06-25 18:06 UTC
rendered paste body
#!/bin/bash
# RDF Feed Display Script by Hellf[i]re v0.1
#
# This script is designed for the Gentoo Linux Security Advisory Feed.
# It will work for other RDF Feeds, but some may need a bit of tweaking.
#
# This script depends on curl.
# Gentoo: emerge -av net-misc/curl
# Debian: apt-get install curl
# Homepage: http://curl.haxx.se/
#
# Usage:
# .conkyrc:     ${execi [time] /path/to/script/conky-rss.sh}
#
# Usage Example
#               ${execi 300 /home/youruser/scripts/conky-rss.sh}


#RSS Setup
URI=http://www.gentoo.org/rdf/en/glsa-index.rdf #URI of RSS Feed
LINES=6                                         #Number of headlines

#Environment Setup
EXEC="/usr/bin/curl -s"                         #Path to curl

#Work Start
$EXEC $URI | grep title |\
sed -e :a  -e 's/<[^>]*>//g;/</N' |\
sed -e 's/[ \t]*//' |\
sed -e 's/\(.*\)/ \1/' |\
sed -e 's/\.//' |\
sed -e 's/\"//' |\
sed -e 's/\"//' |\
head -n $(($LINES + 1)) |\
tail -n $LINES