Zed Lopez

I Heart the Command Line

Via Metafilter I found Five Great Comic Book Adaptations Of Movies (And One That’s Just Really Cool But Kind of Terrible). Sienkiewicz did the art for a Dune movie adaptation? Web searching brought me to a blog post with scans. It’d be a pain to point-and-click each page though. I saved the source as dune.html and looked at it.

perl -ne 'while (/href="(.*?sienkiewicz.*?\.jpg)"/g) { print "$1\n"}' dune.html|xargs wget

Blogspot’s doing something a little peculiar though – those look like links directly to jpegs, but they’re really returning html pages that have img tags requesting the actual jpeg. So…

perl -ne '/src="(.*?sienkiewicz.*?jpg)"/ && print "$1\n"' *sienkiewicz*jpg|xargs wget

wget automatically appended .1 to these jpegs because they would have had the same filenames as the html pages.

rm *sienkiewicz*jpg
rename 's/\jpg\.1$/jpg/' *sienkiewicz*jpg.1

After the fact, I realized I could have just changed the s1600-h’s in the original html page to s1600 – oh well.

Easiest way to read the result is to zip it into a cbz file.

zip -r dune.cbz *sienkiewicz*jpg 

Installed a cbz reader and checked it out. Oops. Page 1 is screwed up – it was still the html.

rm *001.jpg dune.cbz
wget http://3.bp.blogspot.com/_Rf9S3GkkeyI/SU4jMy6nGQI/AAAAAAAAIqM/JdvMxNup3_0/s1600/bill+sienkiewicz+and+ralph+macchio.+dune.+page.+001.jpg
zip -r dune.cbz *sienkiewicz*jpg 

Done. Hey, Steranko’s Outland is even easier.

wget http://www.forcesofgeek.com/2013/06/read-jim-sterankos-outland-adaptation.html
fgrep s1600 read-jim-sterankos-outland-adaptation.html|perl -ne 'while (/href="(.*?\.jpg)"/g) { print "$1\n" }'|xargs wget
zip -r outland.cbz IMG*jpg