Monday, October 09, 2006

Comics script 2nd version

New:can accept dates



#!/bin/sh

if test $1 = 'cal'
then
varmd=$2
else
varmd=`date +%m%d`
fi

shtdate=`date +%y${varmd}`
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${varmd} -d "-11 year"`;
`wget -nd -P comix/ http://images.ucomics.com/comics/ch/${cvyear}/ch${cvshtdate}.gif&`;;
dilbert)fmtdate=`date +%Y${varmd}`;
`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${varmd}`;
`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${varmd}`;
`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&`;;
wizofid)fmtdate=`date +%Y${varmd}`;
`wget -nd -r -l1 -P comix/ -A wizardofid[0-9]*\.gif,wizardofid[0-9]*\.jpg http://www.comics.com/creators/wizardofid/archive/wizardofid-${fmtdate}.html&`;;
*)echo "you entered shit";;
esac
done

No comments: