Class: Feedjira::Parser::AtomFeedBurner

Inherits:
Object
  • Object
show all
Includes:
FeedUtilities, SAXMachine
Defined in:
lib/feedjira/parser/atom_feed_burner.rb

Overview

Parser for dealing with Feedburner Atom feeds.

Constant Summary

Constants included from FeedUtilities

FeedUtilities::UPDATABLE_ATTRIBUTES

Instance Attribute Summary collapse

Attributes included from FeedUtilities

#etag, #last_modified, #new_entries, #updated

Class Method Summary collapse

Methods included from FeedUtilities

included, #new_entries?, #sanitize_entries!, #update_attribute, #update_from_feed, #updated?

Instance Attribute Details

#feed_urlObject

Feed feed_url is <link> with type=“application/atom+xml” if present, <atom10:link> with type=“application/atom+xml” otherwise



35
36
37
# File 'lib/feedjira/parser/atom_feed_burner.rb', line 35

def feed_url
  @feed_url || @feed_url_link || @feed_url_atom10_link
end

#urlObject

Feed url is <link> with type=“text/html” if present, <link> with no type attribute otherwise



29
30
31
# File 'lib/feedjira/parser/atom_feed_burner.rb', line 29

def url
  @url || @url_text_html || @url_notype
end

Class Method Details

.able_to_parse?(xml) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/feedjira/parser/atom_feed_burner.rb', line 23

def self.able_to_parse?(xml)
  (xml.include?("<feed") && xml.include?("Atom") && xml.include?("feedburner") && !(/<rss|<rdf/ =~ xml)) || false
end

.preprocess(xml) ⇒ Object



39
40
41
# File 'lib/feedjira/parser/atom_feed_burner.rb', line 39

def self.preprocess(xml)
  Preprocessor.new(xml).to_xml
end