kicad-get-rss 1.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh
# RSS Feed Display Script by Hellf[i]re v0.1
#
# This script is designed for most any RSS Feed. As some feeds may
# not be
# completely compliant, it 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}
#
16 17 18
# Applications needed:
# bash, cat, grep, sed, curl
#
19 20 21 22 23 24 25 26
# Usage Example
# ${execi 300 /home/youruser/scripts/conky-rss.sh}

#RSS Setup
URI=http://sourceforge.net/export/rss2_keepsake.php?group_id=145591 #URI of RSS Feed
FEEDFILE="/tmp/kicad-svn-`date +%y%m%d-%H%M%S`.rss"
URLFILE="/tmp/kicad-svn-`date +%y%m%d-%H%M%S`.url"

27
# Get feed and save
28 29 30
EXEC="/usr/bin/curl -s" #Path to curl
`$EXEC $URI &> $FEEDFILE`

31 32 33 34 35 36 37 38 39 40
# Get commit description
cat $FEEDFILE                | \
grep title                   | \
sed -e 's/[ \t]*//'          | \
sed -e '/activity/d'         | \
sed -e '/artifact/d'         | \
sed -e 's/<title>//'         | \
sed -e 's/<\!\[CDATA\[//'    | \
sed -e 's/\]\]>//'           | \
sed -e 's/<\/title>//'
41

42
# Space between descriptions and messages
43 44
echo ""

45 46 47 48 49 50 51 52
# Get viewvc urls only
cat $FEEDFILE         | \
grep link             | \
sed -e '/tracker/d'   | \
sed -e '/export/d'    | \
sed -e 's/[ \t]*//'   | \
sed -e 's/<link>//'   | \
sed -e 's/<\/link>//' &> $URLFILE
53

54 55 56 57 58 59
# Get commit messages from urls
exec < $URLFILE
while read LINE
do
	curl -s "$LINE" | \
	grep vc_log  | \
60 61 62
	sed -e 's/<td><pre class=\"vc_log\">//' | \
	sed -e 's/<\/pre><\/td>//' | \
	sed -e '/<style/d'
63
done
64

65
rm /tmp/kicad-svn-*