Skip to content

Instantly share code, notes, and snippets.

@samstokes
Created March 20, 2011 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samstokes/878105 to your computer and use it in GitHub Desktop.
Save samstokes/878105 to your computer and use it in GitHub Desktop.
Callbacks? What callbacks?
require 'em-http'
require 'hpricot'
class EM::HttpRequest
synchronous_shim! :get
end
Hpricot(EM::HttpRequest.new('http://www.samstokes.co.uk/').get.response).at(:title).inner_text
# => "Sam Stokes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment