Skip to content

Instantly share code, notes, and snippets.

@gary-rafferty
Created January 20, 2012 11:20
Show Gist options
  • Save gary-rafferty/1646779 to your computer and use it in GitHub Desktop.
Save gary-rafferty/1646779 to your computer and use it in GitHub Desktop.
Dirty dart screen scrape
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