QC downloader

From WikiPaul - Paul Swanson's wiki

Jump to: navigation, search
#!/bin/bash

rm index.html
wget questionablecontent.net

HAVE=$((`ls comics/ | wc -l` + 1))
LATEST=`egrep '/comics/([0-9]+).png' index.html | egrep -o [0-9]+`

for i in `seq $HAVE $LATEST`;
do
	wget -nc -P comics http://questionablecontent.net/comics/$i.png 
done

rm index.html

if [ -e !qc.tar ]
then
        tar cf qc.tar comics/
else
	tar uvf qc.tar comics/
fi