Skip to content

Instantly share code, notes, and snippets.

@rb2k
Created February 13, 2010 16:43
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 rb2k/303535 to your computer and use it in GitHub Desktop.
Save rb2k/303535 to your computer and use it in GitHub Desktop.
require "rubygems"
require "eventmachine"
require 'em-http'
class Tester
def crawl(url)
EM.run do
http = EM::HttpRequest.new(url.to_s).get
http.callback {
puts http.response[/\d* so far/]
EM.stop
}
end
end
end
bla =Tester.new
loop do
bla.crawl("http://global-count.heroku.com/")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment