lib/oddb2xml/downloader.rb in oddb2xml-1.1.4 vs lib/oddb2xml/downloader.rb in oddb2xml-1.1.5
- old
+ new
@@ -199,6 +199,26 @@
File.unlink file
end
end
end
end
+ class YweseeBMDownloader < Downloader
+ def init
+ super
+ @url ||= 'http://www.ywesee.com/uploads/Main/BM_Update.txt'
+ end
+ def download
+ file = 'ywesee_bm_update.txt'
+ begin
+ response = @agent.get(@url)
+ response.save_as file
+ return File.open(file, 'r')
+ rescue Timeout::Error
+ retrievable? ? retry : raise
+ ensure
+ if File.exists? file
+ File.unlink file
+ end
+ end
+ end
+ end
end