]> gitweb.michael.orlitzky.com - dead/whatever-dl.git/blobdiff - src/website.rb
Factored out the Youtube implementation of get_page_data into the Website superclass.
[dead/whatever-dl.git] / src / website.rb
index b5a501f9db8184d403d93ee1c13a34900b10506d..5e064799cd3ede567d732e1f3e2f5c8f72aaf51a 100644 (file)
@@ -48,6 +48,21 @@ class Website
     return uri.host
   end
 
+
+  
+  def get_page_data(url)
+    # 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)
+    end
+
+    return response.body
+  end
+
+  
   
   public;