]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/commitdiff
Allow passing headers (default: {}) to the Website get_page_data method.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 17 Apr 2010 19:28:17 +0000 (15:28 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 17 Apr 2010 19:28:17 +0000 (15:28 -0400)
src/website.rb

index bfa1b3d618a04163856fee297dd65ce4b0e380b8..2f03e6cb4c383fa63093553a60317925bee51183 100644 (file)
@@ -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