Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
output.txt
readme

readme

Purpose: Try to load a URL to see if a site is alive. Handles http and https.


Usage: 

./http_status.rb http://127.0.0.1


		Connection Refused
		return value is nil

./http_status.rb http://www.cnn.com/index/


		404 Not Found
		returned status: {:available=>true}

./http_status.rb https://msp.f-secure.com/web-test/common/test.html


		200 OK
		returned status: {:available=>true}

./http_status.rb http://www.cnn.com/


		200 OK
		returned status: {:available=>true}

./http_status.rb http://thisisgarbage


		Illegal URL
		return value is nil


Something went wrong with that request. Please try again.