Skip to content
Browse files

initial import

  • Loading branch information...
0 parents commit 5cc24cc9c57a8fdecc41c6403acd7d345c07fc01 Jason Draper committed Dec 20, 2010
Showing with 24 additions and 0 deletions.
  1. +3 −0 config.rb
  2. +21 −0 init.rb
3 config.rb
@@ -0,0 +1,3 @@
+#Configuration Options
+WEBSITE_URL = "http://www.wdbj7ftp.com/wxclose.htm"
+SCHOOLS = ["Floyd Co.", "Montgomery Co.", "Henry Co."]
21 init.rb
@@ -0,0 +1,21 @@
+#!/usr/bin/ruby
+require 'rubygems'
+require 'hpricot'
+require 'open-uri'
+
+require File.join(File.expand_path(File.dirname(__FILE__)), "config.rb")
+
+doc = Hpricot(open(WEBSITE_URL))
+
+for school in SCHOOLS
+ #First we need to open the page
+ status = "Regular Schedule"
+ (doc/"body//table//td").each do |item|
+ if item.inner_html.strip == school
+ status = item .next.inner_html
+ end
+ end
+ #clean up the school name:
+ name = school.split(" ")[0]
+ puts name + ": " + status
+end

0 comments on commit 5cc24cc

Please sign in to comment.
Something went wrong with that request. Please try again.