Skip to content

Instantly share code, notes, and snippets.

@johnnypez
Created September 20, 2013 15:05
Show Gist options
  • Save johnnypez/6638930 to your computer and use it in GitHub Desktop.
Save johnnypez/6638930 to your computer and use it in GitHub Desktop.
opens random devops reaction for your enjoyment :)
#!/usr/bin/env ruby
require 'open-uri'
require 'rexml/document'
feed = open("http://devopsreactions.tumblr.com/api/read?num=50").read
doc = REXML::Document.new feed
posts = []
REXML::XPath.each doc, '//post' do |node|
posts << node.attributes["url"]
end
url = posts.sample
exec "open \"#{url}\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment