Skip to content

Instantly share code, notes, and snippets.

@jicksta
Created August 24, 2008 08:40
Show Gist options
  • Save jicksta/6975 to your computer and use it in GitHub Desktop.
Save jicksta/6975 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'sinatra'
def overview
Hpricot open("http://docs.adhearsion.com/@api/deki/pages?format=xml")
end
def page_contents_for_id(id)
Hpricot open("http://docs.adhearsion.com/@api/deki/pages/#{id}/contents?format=xml").read
end
get '/' do
start = Time.now
page_contents_for_id(overview.at("pages page")['id']).at("content body").inner_text + (Time.now - start).to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment