#!/bin/ksh # update-feed: update my RSS/Atom feeds PATH=/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin http_proxy=http://proxy.com:8080/ export PATH http_proxy die () { echo "$tag: $@" >& 2 exit 1 } version () { lsedscr='s/RCSfile: // s/.Date: // s/,v . .Revision: / v/ s/\$//g' lrevno='$RCSfile: update-feed,v $ $Revision: 1.2 $' lrevdate='$Date: 2008/12/30 02:26:24 $' echo "$lrevno $lrevdate" | sed -e "$lsedscr" } # Configuration section. top="/home/vogelke/notebook/2007/0315/feed-reader/planet" url="/planet/me" dest="/doc/html/htdocs/$url" # Sanity checks. test -d "$top" || die "$top: not found" test -d "$dest" || die "$dest: destination not found" cd $top || die "$top: can't cd" # Update feeds. if test -f "planet.py" then python planet.py me-meta/config.ini else echo "no planet.py file found" >& 2 exit 1 fi # Move results to directory named after today's date. cd examples/output || die "output: can't cd" set X `date "+%Y %m%d"`; yr=$2; md=$3 daily="$dest/$yr/$md" test -d "$daily" || mkdir -p "$daily" || die "can't mkdir $daily" mv *.xml $daily cp index.html $daily/index.htm # Create redirect from the main page to today's news. cat < $dest/index.htm Redirecting... EndIndex exit 0