Saturday, September 09, 2006

Comics script

file name: comics
Downloads daily comic strips.

#!/bin/sh
shtdate=`date +%y%m%d`
lngyear=`date +%Y`
for i in $@
do
case $i in
garfeild)`wget -nd -P comix/ http://images.ucomics.com/comics/ga/${lngyear}/ga${shtdate}.gif`;;
calvin)cvyear=`date +%Y -d "-11 year"`;cvshtdate=`date +%y%m%d -d "-11 year"`;
`wget -nd -P comix/ http://images.ucomics.com/comics/ch/${cvyear}/ch${cvshtdate}.gif`;;
dilbert)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A dilbert[0-9]*\.gif,dilbert[0-9]*\.jpg http://www.dilbert.com/comics/dilbert/archive/dilbert-${fmtdate}.html`;;
peanuts)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A peanuts[0-9]*\.gif,peanuts[0-9]*\.jpg http://www.snoopy.com/comics/peanuts/archive/peanuts-${fmtdate}.html`;;
bornloser)fmtdate=`date +%Y%m%d`;
`wget -r -l1 -nd -P comix/ -A bornloser[0-9]*\.gif,bornloser[0-9]*\.jpg http://www.comics.com/comics/bornloser/archive/bornloser-${fmtdate}.html`;;
archie)fmtdate=`date +%d -d "-3 day"`;
`wget -nd -P comix/ http://www.archiecomics.com/pops_shop/dailycomics/image${fmtdate}.gif`;;
*)echo "you entered shit";;
esac
done

No comments: