Created
May 31, 2009 09:13
-
-
Save siuying/120825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scRUBYt script that parse tvb scheule and return XML | |
# Sample Output: http://gist.github.com/120827 | |
# | |
require 'rubygems' | |
require 'scrubyt' | |
tvb = Scrubyt::Extractor.define do | |
fetch "http://schedule.tvb.com/j2/20090531.html?category=all" | |
schedule "//div[@class='content']" do | |
program "//tr" do | |
time "//td[1]" | |
name "//td[2]/span[1]" | |
details "//td[2]/div" | |
end.ensure_presence_of_pattern("time").ensure_presence_of_pattern("name") | |
end | |
end | |
puts tvb.to_xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment