#!/usr/local/bin/bash
OLDIFS=IFS;
IFS=`echo -en "\n\b"`


for year in `gseq 1997 2004`
	do
	{
		curl "http://www.userfriendly.org/cartoons/archives/$year.html" >$year.html
	
		for link in `cat $year.html | grep -i ars.userfriendly.org/cartoons | cut -d "\"" -f 2`
			do
			{
			page=`echo $link | cut -d "=" -f 2 | cut -d "&" -f 1`
			curl "$link" >$page.html
			
			for bilde in `cat $page.html | grep -i cartoons | grep .gif | cut -d "\"" -f 6`
				do
				{
				curl "$bilde" >$page.gif
				}
				done

			rm $page.html
			}
			done
	rm $year.html
	}
	done


IFS=OLDIFS;


