Skip to content

Instantly share code, notes, and snippets.

@smathy
Created December 17, 2009 00:41
Show Gist options
  • Save smathy/258378 to your computer and use it in GitHub Desktop.
Save smathy/258378 to your computer and use it in GitHub Desktop.
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