Created
December 4, 2011 13:59
-
-
Save happyrobots/1430267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
heroku_status_url = "https://status.heroku.com" | |
doc = Nokogiri::HTML(open(heroku_status_url)) | |
problems, problem_types = [], { "app" => "App Operations", "tools" => "Tools" } | |
problem_types.each_pair do |key, name| | |
is_having_issue = doc.css("div#open ol.status li.#{key}.green").empty? | |
problems << name if is_having_issue | |
end | |
exit if problems.empty? | |
verb = problems.size == 1 ? "is" : "are" | |
alert = "It looks like Heroku #{problems.join(' and ')} #{verb} having some issues." | |
`open #{heroku_status_url} ; say #{alert}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment