Skip to content

Instantly share code, notes, and snippets.

@subelsky
Created March 28, 2012 15:29
Show Gist options
  • Save subelsky/2227323 to your computer and use it in GitHub Desktop.
Save subelsky/2227323 to your computer and use it in GitHub Desktop.
Parsing surveymonkey result data
html = IO.read("survey.html")
rows = Nokogiri::HTML(html).css("tr")[????].collect { |r| r.children.to_a.values_at(0,3).collect(&:content) }.sort_by(&:last).reverse.collect { |r| "#{r.first} - #{r.last}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment