Skip to content

Instantly share code, notes, and snippets.

@quirkey quirkey/lol
Created Sep 3, 2010

Embed
What would you like to do?
#!/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 "could not find lol"
end
end
@quirkey

This comment has been minimized.

Copy link
Owner Author

quirkey commented Sep 3, 2010

Ideal usage:

  open `lol`
@quirkey

This comment has been minimized.

Copy link
Owner Author

quirkey commented Sep 3, 2010

If you're daring
curl http://gist.github.com/raw/563236/d2b6f73ea2bd1ed82b4bbbea883d00dbd22ecb06/lol > /usr/local/bin/lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.