#!/bin/bash
for i in `seq 1 472`
do
wget http://xkcd.com/$i/
wget `grep http://imgs.xkcd.com/comics/ index.html | head -1 | cut -d\" -f2`
mv `grep http://imgs.xkcd.com/comics/ index.html | head -1 | cut -d\/ -f5 | cut -d\" -f1` $(echo $(echo $i"_")`grep http://imgs.xkcd.com/comics/ index.html | head -1 | cut -d\/ -f5 | cut -d\" -f1`)
rm index.html
done
Made a few modifications to the earlier code so that the comics are named according the sequence that they were put up.
Make the file executable and execute as ::
$sh filename Happy reading.



8 comments:
Yay....
good good....
creative work !!:)
keep it up dude, niiiccceee!! :-)
explain that script please !!
See... I told you the first time. Download first and then rename. Don't try to do both things at the same time... but you don't listen....
@aditya:: aah...yes...i forget....it was ur idea...thanks for that..and i did the same thing eventually...
so i did listen
wat is dis..
wats dis for??
@aniket:: check the previous posts regarding xkcd ... its a webcomic
Post a Comment