Skip to content

Commit

Permalink
Update for April 10th 2013 outage
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahandrews committed Apr 10, 2013
1 parent ca0fadf commit 6ee1dd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,9 @@ check-if-learn-is-not-down

On Tuesday, January 29th 2013, https://learn.uwaterloo.ca went down. Without our beloved Learn, panic struck the hearts of all Univeristy of Waterloo students. This Ruby script checks if Learn is still down every 5 minutes. If it finds Learn not down, it ensures near instantaneous rejoice by sending you an email.

EDIT: As of February 1st, Learn is back. However, this tool may once again be useful if Learn goes down again.
EDIT: As of February 1st 2013, Learn is back. However, this tool may once again be useful if Learn goes down again.

EDIT2: As of April 10th 2013, Learn is down again.

## Setup
Make sure you have [Ruby](http://www.ruby-lang.org/en/downloads/) and [nokogiri](http://nokogiri.org/tutorials/installing_nokogiri.html)
Expand Down
3 changes: 2 additions & 1 deletion check_if_learn_is_not_down.rb
Expand Up @@ -15,6 +15,7 @@
Gmail.new(address, password) do |gmail|
puts "Logged in"
br = Mechanize.new
br.read_timeout = 20

loop do
puts "#{ Time.now }: Checking Learn..."
Expand All @@ -23,7 +24,7 @@
rescue
errored = true
end
if page.body =~ /maintenance\.jpg/ || errored # maintenance.jpg == that blue gear we are all tired of
if errored || page.nil? || page.body =~ /maintenance\.jpg/ # maintenance.jpg == that blue gear we are all tired of
errored = false
puts "#{ Time.now }: Still down. Waiting 5 minutes."
sleep(300) # wait 5 minutes
Expand Down

0 comments on commit 6ee1dd3

Please sign in to comment.