Created
January 20, 2012 11:20
-
-
Save gary-rafferty/1646779 to your computer and use it in GitHub Desktop.
Dirty dart screen scrape
This file contains hidden or 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
BASE_URL = "http://www.irishrail.ie/your_journey/ajax/ajaxRefreshResults.asp?station=" | |
trains = [] | |
station = URI.escape(params[:station]) | |
doc = Nokogiri::HTML(open("#{BASE_URL}#{station}")) | |
doc.search('tr').each {|t| trains << t if t.content =~ /DART/} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment