Quantcast
Channel: Sriunplugged » Search Results » rhel-setup-cd-repo
Viewing all articles
Browse latest Browse all 13

Download PHD Comics,XKCD and DogHouseDiaries for Offline Viewing (E-book Reader)

$
0
0

If you are like me who wants to read comics on kindle then this is the script for you. You can download all the comics to read it in a kindle. So here is how you do you do it. Download all the comics into 3 different folder s for each comic set by running the following scripts.

PHD Comics

#!/bin/bash
for i in {1..1557} # Or whichever is the current biggest comic number
do
	curl -s http://www.phdcomics.com/comics/archive.php?comicid=$i|grep "<td bgcolor=#FFFFFF align=center><img src=http://www.phdcomics.com/comics/archive/"|sed s'/[ ]*<td bgcolor=#FFFFFF align=center><img src=//'|sed 's/ align=top>.*//'|xargs wget -O $i.gif
done

XKCD

#!/bin/bash
for i in {1..1170}
do
curl http://xkcd.com/$i/|grep "<img src=\"http://imgs.xkcd.com/comics/"|sed 's/<img src=\"//'|sed 's/\" title=.*//'|xargs wget -O $i.png
done

The Doghouse Diaries

#!/bin/bash
for i in `curl http://thedoghousediaries.com/archive| grep "rel=\"bookmark\""|sed 's/.*<a href="\([^"]*\)".*/\1/'`
do
curl $i|grep "class=\"comic-item"|sed 's/.*<img src="\([^"]*\)\".*/\1/'|xargs wget
done

And now run the following command to create a HTML page which has all the images.

#!/bin/bash
echo "<html><head><title>The Dog House Diaries</title><body>"
for i in `ls`
do
echo "<div><img src="$i" /></div>"
done
echo "</body><html>"

Pipe the output to a file say comic.html. You can send this comic file to kindle using send to kindle option in your browser or use Calibre which accepts html page and converts into your e-book reader format



Viewing all articles
Browse latest Browse all 13

Trending Articles