Skip to content

Instantly share code, notes, and snippets.

@thegcat
Created July 29, 2011 12:21
Show Gist options
  • Save thegcat/1113710 to your computer and use it in GitHub Desktop.
Save thegcat/1113710 to your computer and use it in GitHub Desktop.
Menüs von der stwdo Seite scrapen
%w(open-uri rubygems nokogiri).each{|m| require m}
Nokogiri::HTML(open("http://www.stwdo.de/index.php?id=102")).css('table.SpeiseplanHeute tr').inject({}) {|m,r| m.merge((c=r.css('td').collect(&:content))[0] => c[1])}.delete_if {|k,v| k.nil?}.each {|k,v| puts "#{k}: #{v}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment