Quantcast
Viewing all articles
Browse latest Browse all 25

Save xkcd to a pdf with captions

$ curl -sL xkcd.com | grep '<img [^>]*/><br/>' | sed -r 's|<img src="(.*)" title="(.*)" alt="(.*)" /><br/>|\1\t\2\t\3|' > /tmp/a; curl -s $(cat /tmp/a | cut -f1) | convert - -gravity south -draw "text 0,0 \"$(cat /tmp/a | cut -f2)\"" pdf:- > xkcd.pdf

Saves to a PDF with title and alt text of comic.

As asked for on http://bbs.archlinux.org/viewtopic.php?id=91100

Change xkcd.com to dynamic.xkcd.com/comics/random for a random comic.

Image may be NSFW.
Clik here to view.
commandlinefu.com

Diff your entire server config at ScriptRock.com


Viewing all articles
Browse latest Browse all 25

Trending Articles