View on GitHub

Xkcd-gem

XCKD ruby gem to get random img url or comic urls

download .ZIPdownload .TGZ

Just do a gem install xkcd

And then :

require 'xkcd'
p XKCD.img   # To get random comic image URL and title
p XKCD.comic # Get the random comic URL
p XKCD.search "classhole" #Does a Google search for comic containing the search phrase and returns first comic result