Ruby gem to check on the status of a website
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Spacejam -- A simple tool to check on the status of a website

Spacejam is a ruby library for checking on the status of a website. You can use it to check if a page or site is online. I wrote it to keep an eye on the website for Space Jam. I wrote a Twitter bot that checks the status of the website multiple times a day.

The library is basically a very simple wrapper around Curl. Here's how it works:'')
=> true

x ='')
=> true

Instead of just passing a URL, you can pass a hash with the URL and an expected response code:

x ='', response_code:200)
=> false

You can also check non-200 response codes. Admittedly, looking for a 404 seems a little odd, but it still has it's uses.

x ='', response_code:404)
=> true

Also, you can check the body content of the page:

x ='', body:"A string to check for")
=> true

Both body and response_code attributes can be a regex:

x =
=> true

If the request isn't successful, Spacejam can give you some information about what went wrong via the reason attribute:

=> :response_code

The possible values are:

  • :response_code - an unexpected response code
  • :body - the body check failed
  • :error - a network/DNS error, etc. You would get this if the remote server was inaccessible or unresponsive.

Finally, if all you want to do is check on the status of the movie website, there's a shortcut for that:



Add this line to your application's Gemfile:

gem 'spacejam'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spacejam


Please do! Pull requests are welcomed.


Copyright (c) 2014 Colin Mitchell. MIT License. Keep Circulating The Tapes.