/home/a/aquarion/sites/www.aquarionics.com/epistula/contrib/blogroll.sh
All my code (That is, anything not in the "Others" list on the right) is BSD licenced.
You can also view this page as text/plain or colour-coded source
#!/bin/bash
## Set some handy parameters
#Bloglines account name
account="aquarion"
# WGet Executable
wget="wget"
# Where to put the finished file
file="/home/webusers/aquarion/sites/aquarionics/data/blogroll.html"
# If there's already a backup file, delete it.
if [[ -e $file.bak ]]
then
rm $file.bak
fi
# If there's already a final file, turn it into a backup file.
if [[ -e $file ]]
then
mv $file $file.bak
fi
#Get the new blogroll as a temporary file
$wget -qq "http://rpc.bloglines.com/blogroll?html=1&id=$account" -O $file.pre
# Strip out the horrible <p /> tags and send it to the final location
cat $file.pre | sed -e"s#<p />##g" > $file
# then get rid of the temporary file
rm $file.pre
# Finally, output a diff of the old blogroll against the new one,
# since this is run from cron if there are any differences, they get mailed to me.
if [[ -e $file.bak ]]
then
diff $file.bak $file
fi
Using a heavily customised version of Tom's PHPCode2ValidXHTML Thing