Skip to content

Commit

Permalink
Support http(s)_proxy ENV variables
Browse files Browse the repository at this point in the history
Closes issue #65
  • Loading branch information
antoneliasson committed Oct 31, 2016
1 parent 4177425 commit 54bd5d3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/wayback_machine_downloader/archive_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ def get_raw_list_from_api url, page_index
request_url = "http://web.archive.org/cdx/search/xd?url="
request_url += url
request_url += parameters_for_api page_index
request_uri = URI.parse request_url
response = Net::HTTP.get_response request_uri
response.body

request_uri = URI.parse request_url
Net::HTTP.new('web.archive.org', nil).start { |http|
request = Net::HTTP::Get.new request_uri
response = http.request request
response.body
}
end

def parameters_for_api page_index
Expand All @@ -28,4 +32,4 @@ def parameters_for_api page_index
parameters
end

end
end

0 comments on commit 54bd5d3

Please sign in to comment.