Skip to content

Instantly share code, notes, and snippets.

@jordandobson
Created October 8, 2009 21:30
Show Gist options
  • Save jordandobson/205438 to your computer and use it in GitHub Desktop.
Save jordandobson/205438 to your computer and use it in GitHub Desktop.
require 'open-uri'
module SchoolReport
NO_ALERT = "0"
ALERT = /.+\w+\s+(\d)\s+\d+/
URL = 'http://media.schoolreport.org/media/export.php?userId=422'
def self.has_alert?
open(URL) do |report|
report.each_line do |school|
school_has = school[ALERT,1]
unless school_has == NO_ALERT || school_has == nil
return true
break
end
end
end
false
end
end
puts SchoolReport.has_alert?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment