Module: IsDown
- Defined in:
- lib/is_down.rb,
lib/is_down/version.rb
Overview
check if a website is up or not using downforeveryoneorjustme.com
Constant Summary collapse
- ISUPME =
"http://downforeveryoneorjustme.com"
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.is_down?(host) ⇒ Boolean
check if a website is down takes a domain name as the only argument.
-
.is_up?(host) ⇒ Boolean
opposite of is_down? checks if a website is up takes a domain name as the only argument.
Class Method Details
.is_down?(host) ⇒ Boolean
check if a website is down takes a domain name as the only argument
10 11 12 |
# File 'lib/is_down.rb', line 10 def self.is_down?(host) !is_up?(host) end |
.is_up?(host) ⇒ Boolean
opposite of is_down? checks if a website is up takes a domain name as the only argument
17 18 19 |
# File 'lib/is_down.rb', line 17 def self.is_up?(host) Net::HTTP.get_response(URI(ISUPME + "/" + host)).body.include?("is up") end |