Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download all the User Friendly comics!
#!/bin/bash
years="1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015"
months1="01 02 03 04 05 06 07 08 09 10 11 12"
months2="11 12"
n=1
for y in $years
do
if [ $y = "1997" ]; then
months=$months2
else
months=$months1
fi
for m in $months
do
d=1
while [ $d -lt 31 ];
do
rd=""
if [ $d -lt 10 ]; then
rd="0$d"
else
rd="$d"
fi
echo -ne Searching number $n\\r
url="http://ars.userfriendly.org/cartoons/?id=${y}${m}${rd}"
wget $url -O tmp.html 2> /dev/null
image=`cat tmp.html | grep -o "http://www.userfriendly.org/cartoons/archives/.\+\.gif"`
if [ "$image" != "" ]; then
if [ ! -f "${n}.png" ]; then
echo -ne Downloading number $n\\r
wget $image -O "${n}.gif" 2> /dev/null
convert -verbose -coalesce "${n}.gif" "${n}.png"
if [ -f tmp.html ]; then
rm tmp.html
fi
rm *.gif
fi
let "n++"
fi
let "d++"
done
done
done
@sethleedy
Copy link

sethleedy commented May 3, 2016

Nice!

@JulianWebb
Copy link

JulianWebb commented Jun 15, 2022

Do you happen to still have the archive? They took down the site in February of this year.

@felipetavares
Copy link
Author

felipetavares commented Jun 15, 2022

@JulianWebb I don't :/

@DosGamerMan
Copy link

DosGamerMan commented Jul 15, 2022

Forked this to download from archive.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment