http_status_cheker - easily check status [RubyGems]

I created a new RubyGem morizyun/http_status_cheker.

Features

  • Easily checking http status of multi URIs
  • A threaded (fast) per host name
  • Return redirect url and errors when get http access
  • a waiting time interval can be set, because not to access too much to one host.

Installation

Add this line to your application’s Gemfile:

1
gem 'http_status_checker'

And then execute:

1
$ bundle

Or install it yourself as:

1
$ gem install http_status_checker

Usage on Command Line

1
2
3
$ http_status_checker -u http://morizyun.github.io
#=> url: http://morizyun.github.io
#=> response: {:code=>"200", :is_alive=>true, :redirect_url=>nil}

Usage on Ruby Program

1
2
3
4
5
6
7
8
require 'http_status_checker'
urls = ['http://morizyun.github.io', 'http://www.yahoo.co.jp']
interval_sec = 1
HttpStatusChecker.check urls, interval_sec
#=> [{"http://morizyun.github.io"=>{:code=>"200", :is_alive=>true, :redirect_url=>nil}},
#=> {"http://www.yahoo.co.jp"=>{:code=>"200", :is_alive=>true, :redirect_url=>nil}}]