lib/twitterscraper/http.rb in twitterscraper-ruby-0.3.0 vs lib/twitterscraper/http.rb in twitterscraper-ruby-0.4.0
- old
+ new
@@ -7,10 +7,11 @@
timeout ||= 3
if proxy
ip, port = proxy.split(':')
http_class = Net::HTTP::Proxy(ip, port.to_i)
+ Twitterscraper.logger.info("Using proxy #{proxy}")
else
http_class = Net::HTTP
end
uri = URI.parse(url)
@@ -22,9 +23,10 @@
headers.each do |key, value|
req[key] = value
end
- http.request(req).body
+ res = http.start { http.request(req) }
+ res.body
end
end
end