Skip to content

Instantly share code, notes, and snippets.

@swindsor
Created November 4, 2011 01:04
Show Gist options
  • Save swindsor/1338409 to your computer and use it in GitHub Desktop.
Save swindsor/1338409 to your computer and use it in GitHub Desktop.
Best on-liner of the day.
Hash[*(doc/"/b").map{|e| [e.inner_html.squeeze(" ").chomp(" ").chomp(":"), e.next.to_s.squeeze(" ").chomp(" ")] }.flatten]
@swindsor
Copy link
Author

swindsor commented Nov 4, 2011

turns "<b>Field: </b> Value <br />" into {"Field" => "Value"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment