Created
February 19, 2010 14:09
-
-
Save reactormonk/308722 to your computer and use it in GitHub Desktop.
This file contains 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
require 'nokogiri' | |
app = proc do |env| | |
doc = Nokogiri::HTML('<html><head></head><body><div id="hello">Hello World</div></body></html>') | |
body = doc.css('#hello').content | |
[body, 200, { 'Content-Type' => 'text/plain', 'Content-Length' => body.size.to_s }] | |
end | |
run app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment