Skip to content
Browse files

Fixed RemoteRequest::Get.read(uri)

  • Loading branch information...
1 parent b36222d commit 5a2620c66ee03c155d5ab68a3f0164257b5c1f8b @Pticed committed Sep 10, 2011
Showing with 7 additions and 7 deletions.
  1. +3 −3 bin/tvmover
  2. +4 −4 lib/ruby-tvscripts/remote_request.rb
View
6 bin/tvmover
@@ -67,11 +67,11 @@ class Series
end
def get_series_xml
- url = URI.parse("http://thetvdb.com/api/GetSeries.php?seriesname=#{CGI::escape(@name)}&language=en")
+ uri = URI.parse("http://thetvdb.com/api/GetSeries.php?seriesname=#{CGI::escape(@name)}&language=en")
- puts "Getting: #{url}"
+ puts "Getting: #{uri}"
- res = RemoteRequest.new("get").read(url)
+ res = RemoteRequest.new("get").read(uri)
doc = Document.new res
View
8 lib/ruby-tvscripts/remote_request.rb
@@ -4,14 +4,14 @@ def initialize(method)
@opener = self.class.const_get(method.capitalize)
end
- def read(url)
- data = @opener.read(url)
+ def read(uri)
+ data = @opener.read(uri)
data
end
private
class Get
- def self.read(url)
+ def self.read(uri)
attempt_number=0
errors=""
begin
@@ -20,7 +20,7 @@ def self.read(url)
return nil
end
- file = Net::HTTP.get_response URI.parse(url)
+ file = Net::HTTP.get_response uri
if (file.message != "OK") then
raise InvalidResponseFromFeed, file.message
end

0 comments on commit 5a2620c

Please sign in to comment.
Something went wrong with that request. Please try again.