Object
Maximum number of redirects to follow on each get_response
Create new Pages from the response of an HTTP request to url, including redirects
# File lib/anemone/http.rb, line 31 def fetch_pages(url, referer = nil, depth = nil) begin url = URI(url) unless url.is_a?(URI) pages = [] get(url, referer) do |response, code, location, redirect_to, response_time| pages << Page.new(location, :body => response.body.dup, :code => code, :headers => response.to_hash, :referer => referer, :depth => depth, :redirect_to => redirect_to, :response_time => response_time) end return pages rescue Exception => e if verbose? puts e.inspect puts e.backtrace end return [Page.new(url, :error => e)] end end
The proxy address string
# File lib/anemone/http.rb, line 80 def proxy_host @opts[:proxy_host] end
The proxy port
# File lib/anemone/http.rb, line 87 def proxy_port @opts[:proxy_port] end
HTTP read timeout in seconds
# File lib/anemone/http.rb, line 94 def read_timeout @opts[:read_timeout] end
Generated with the Darkfish Rdoc Generator 2.