Download all xkcd

by

You can now download all xkcd comics in one go using the following bash script.

#!/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.

Advertisements

8 Responses to “Download all xkcd”

  1. Aditya Says:

    Yay….

  2. @$%deja vu$% Says:

    good good….
    creative work !!:)

  3. Salil Says:

    keep it up dude, niiiccceee!! 🙂

  4. Amod Says:

    explain that script please !!

  5. Aditya Says:

    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….

  6. CDK Says:

    @aditya:: aah…yes…i forget….it was ur idea…thanks for that..and i did the same thing eventually…
    so i did listen

  7. Aniket Zamwar Says:

    wat is dis..
    wats dis for??

  8. CDK Says:

    @aniket:: check the previous posts regarding xkcd … its a webcomic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: