lib/html2rss/item.rb in html2rss-0.8.2 vs lib/html2rss/item.rb in html2rss-0.9.0

- old
+ new

@@ -69,13 +69,15 @@ end private def self.get_body_from_url(url, config) - body = Faraday.new(url: url, headers: config.headers) do |faraday| + request = Faraday.new(url: url, headers: config.headers) do |faraday| faraday.use FaradayMiddleware::FollowRedirects faraday.adapter Faraday.default_adapter - end.get.body + end + + body = request.get.body config.json? ? Html2rss::Utils.object_to_xml(JSON.parse(body)) : body end private_class_method :get_body_from_url