From 54bd5d385246f9c74638230b76c872736732fca7 Mon Sep 17 00:00:00 2001 From: Anton Eliasson Date: Mon, 31 Oct 2016 17:46:35 +0100 Subject: [PATCH 1/4] Support http(s)_proxy ENV variables Closes issue #65 --- lib/wayback_machine_downloader/archive_api.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/wayback_machine_downloader/archive_api.rb b/lib/wayback_machine_downloader/archive_api.rb index 70e8ff2..4f2effd 100644 --- a/lib/wayback_machine_downloader/archive_api.rb +++ b/lib/wayback_machine_downloader/archive_api.rb @@ -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 @@ -28,4 +32,4 @@ def parameters_for_api page_index parameters end -end \ No newline at end of file +end From 8d5be7a89e474f62aa9cf935671214183c36d721 Mon Sep 17 00:00:00 2001 From: hartator Date: Mon, 14 Nov 2016 18:18:58 -0600 Subject: [PATCH 2/4] Fix compatibility with Ruby 1.9.x and proxies --- lib/wayback_machine_downloader/archive_api.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/wayback_machine_downloader/archive_api.rb b/lib/wayback_machine_downloader/archive_api.rb index 4f2effd..d3e82b7 100644 --- a/lib/wayback_machine_downloader/archive_api.rb +++ b/lib/wayback_machine_downloader/archive_api.rb @@ -5,12 +5,7 @@ def get_raw_list_from_api url, page_index request_url += url request_url += parameters_for_api page_index - 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 - } + open(request_url).read end def parameters_for_api page_index From 5195c36156cb3e06d0d72a097e295d45e6863b60 Mon Sep 17 00:00:00 2001 From: hartator Date: Mon, 14 Nov 2016 18:20:06 -0600 Subject: [PATCH 3/4] Remove Rubinius from Rubies following Travis CI issues --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 085fdb9..9e4643d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,3 @@ rvm: - 2.2 - 2.3.1 - jruby - - rbx-2.2.2 From 734521803a451e8676cbf9f027ea6eb2e2fbbcb5 Mon Sep 17 00:00:00 2001 From: hartator Date: Mon, 14 Nov 2016 18:20:16 -0600 Subject: [PATCH 4/4] Bump Gem version --- lib/wayback_machine_downloader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index 9941549..924d7ac 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -14,7 +14,7 @@ class WaybackMachineDownloader include ArchiveAPI - VERSION = "1.1.3" + VERSION = "1.1.4" attr_accessor :base_url, :directory, :from_timestamp, :to_timestamp, :only_filter, :exclude_filter, :all, :list, :maximum_pages, :threads_count