From: Michael Orlitzky Date: Sat, 17 Apr 2010 19:28:17 +0000 (-0400) Subject: Allow passing headers (default: {}) to the Website get_page_data method. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=11aa7c3e702f4ea466152b706f60e154e60e188e;p=dead%2Fwhatever-dl.git Allow passing headers (default: {}) to the Website get_page_data method. --- diff --git a/src/website.rb b/src/website.rb index bfa1b3d..2f03e6c 100644 --- a/src/website.rb +++ b/src/website.rb @@ -56,13 +56,13 @@ class Website - def get_page_data(url) + def get_page_data(url, headers = {}) # A naive implementation that just grabs the # data from a page. uri = URI.parse(url) response = Net::HTTP.start(uri.host, uri.port) do |http| - http.get(uri.request_uri) + http.get(uri.request_uri, headers) end return response.body