Sha256: d97c577ba2de6f5c84d6a4780eeeac5fccb40d6de1c91ffab88cd7ad5f1992da
Contents?: true
Size: 818 Bytes
Versions: 16
Compression:
Stored size: 818 Bytes
Contents
module Feedzirra module Parser # Parser for dealing with Atom feeds. class Atom include SAXMachine include FeedUtilities element :title element :subtitle, :as => :description element :link, :as => :url, :value => :href, :with => {:type => "text/html"} element :link, :as => :feed_url, :value => :href, :with => {:type => "application/atom+xml"} elements :link, :as => :links, :value => :href elements :entry, :as => :entries, :class => AtomEntry def self.able_to_parse?(xml) #:nodoc: /\<feed[^\>]+xmlns=[\"|\'](http:\/\/www\.w3\.org\/2005\/Atom|http:\/\/purl\.org\/atom\/ns\#)[\"|\'][^\>]*\>/ =~ xml end def url @url || links.last end def feed_url @feed_url ||= links.first end end end end
Version data entries
16 entries across 16 versions & 4 rubygems