Skip to content

Instantly share code, notes, and snippets.

@NaWer
Created October 30, 2012 08:57
Show Gist options
  • Save NaWer/3979108 to your computer and use it in GitHub Desktop.
Save NaWer/3979108 to your computer and use it in GitHub Desktop.
Fetch a random lolcat url.
require 'open-uri'
def random_lolcat
open("http://icanhascheezburger.com/?random").read.match(/"http:\/\/icanhascheezburger\.files\.wordpress\.com\/[^"]+/)[0][1..-1]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment