Created
June 7, 2012 17:50
-
-
Save havenwood/2890379 to your computer and use it in GitHub Desktop.
D3 US Server Status from IRB/Pry
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
require 'nokogiri' | |
require 'open-uri' | |
module D3 | |
def self.status | |
status = Nokogiri::HTML(open 'http://us.battle.net/d3/en/status') | |
status.search('div.status-icon').first.attributes['data-tooltip'].value | |
end | |
end | |
D3.status | |
# => "Available" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment