Sha256: 6f0a697d4958ace6d5862fc4ac9ae8770f474dd641afe6eb197ab28bdf64df8e

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

module Feedzirra

  module Parser
    # Parser for dealing with Atom feed entries.
    class AtomEntry
      include SAXMachine
      include FeedEntryUtilities
      
      element :title
      element :link, :as => :url, :value => :href, :with => {:type => "text/html", :rel => "alternate"}
      element :name, :as => :author
      element :content
      element :summary

      element :"media:content", :as => :image, :value => :url
      element :enclosure, :as => :image, :value => :href

      element :published
      element :id, :as => :entry_id
      element :created, :as => :published
      element :issued, :as => :published
      element :updated
      element :modified, :as => :updated
      elements :category, :as => :categories, :value => :term
      elements :link, :as => :links, :value => :href

      def url
        @url ||= links.first
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feedzirra-0.2.1 lib/feedzirra/parser/atom_entry.rb