Skip to content

Instantly share code, notes, and snippets.

@mrb
Forked from quirkey/lol
Created September 3, 2010 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrb/563253 to your computer and use it in GitHub Desktop.
Save mrb/563253 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'open-uri'
category = ARGV[0] || 'fail'
url = "http://api.cheezburger.com/xml/category/#{category}/lol/random"
open(url) do |f|
xml = f.read
if xml =~ /LolImageUrl\>([^\<]*)/m
puts $1
else
puts "OMG LOL IZ NO FOUND"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment