Class: FYT::Parser
Overview
reads and prepares a youtube feed for further processing
Instance Method Summary collapse
-
#initialize(url, proxy_manager) ⇒ Parser
constructor
A new instance of Parser.
- #read ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(url, proxy_manager) ⇒ Parser
Returns a new instance of Parser.
8 9 10 11 |
# File 'lib/fyt/parser.rb', line 8 def initialize(url, proxy_manager) @url = url @proxy_manager = proxy_manager end |
Instance Method Details
#read ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fyt/parser.rb', line 13 def read proxy = @proxy_manager.get! open(@url, proxy: 'http://' + proxy.url) do |rss| return RSS::Parser.parse(rss, false) end rescue @proxy_manager.remove(proxy) read if @proxy_manager.proxies.size > 0 end |