Created
December 17, 2009 00:41
-
-
Save smathy/258378 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 'rubygems' | |
require 'rack' | |
require 'nokogiri' | |
require 'open-uri' | |
class HelloWorld | |
def call(env) | |
lines = Nokogiri::HTML(open('http://stannard.net.au/blog/index.cfm/2009/11/3/Hello-World-with-ColdFusion-and-Spring')).css('div.code').to_s.count("\n") | |
[ 200, { "Content-type" => "text/plain" }, "How can it take #{lines} lines to say Hello?" ] | |
end | |
end | |
Rack::Handler::Mongrel.run HelloWorld.new, :Port => 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment