Class: FeedNormalizer::RubyRssParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/parsers/rss.rb

Class Method Summary collapse

Class Method Details

.parse(xml, loose) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/parsers/rss.rb', line 28

def self.parse(xml, loose)
  begin
    rss = parser.parse(xml)
  rescue Exception => e
    #puts "Parser #{parser} failed because #{e.message.gsub("\n",', ')}"
    return nil
  end

  # check for channel to make sure we're only dealing with RSS.
  rss && rss.respond_to?(:channel) ? package(rss, loose) : nil
end

.parserObject



24
25
26
# File 'lib/parsers/rss.rb', line 24

def self.parser
  RSS::Parser
end

.priorityObject

Fairly high priority; a fast and strict parser.



41
42
43
# File 'lib/parsers/rss.rb', line 41

def self.priority
  100
end