lib/feedzirra/parser/rss_entry.rb in logophobia-feedzirra-0.0.18 vs lib/feedzirra/parser/rss_entry.rb in logophobia-feedzirra-0.0.20
- old
+ new
@@ -1,9 +1,17 @@
require File.dirname(__FILE__) + '/mrss_content'
require File.dirname(__FILE__) + '/mrss_credit'
require File.dirname(__FILE__) + '/mrss_restriction'
require File.dirname(__FILE__) + '/mrss_group'
+require File.dirname(__FILE__) + '/mrss_category'
+require File.dirname(__FILE__) + '/mrss_copyright'
+require File.dirname(__FILE__) + '/mrss_hash'
+require File.dirname(__FILE__) + '/mrss_player'
+require File.dirname(__FILE__) + '/mrss_rating'
+require File.dirname(__FILE__) + '/mrss_restriction'
+require File.dirname(__FILE__) + '/mrss_text'
+require File.dirname(__FILE__) + '/mrss_thumbnail'
module Feedzirra
module Parser
# == Summary
# Parser for dealing with RDF feed entries.
@@ -42,47 +50,25 @@
element :issued, :as => :published
element :"content:encoded", :as => :content
element :"dc:creator", :as => :author
element :"dcterms:modified", :as => :updated
- # MediaRSS support
- element :'media:thumbnail', :as => :media_thumbnail, :value => :url
- element :'media:thumbnail', :as => :media_thumbnail_width, :value => :width
- element :'media:thumbnail', :as => :media_thumbnail_height, :value => :height
- element :'media:description', :as => :media_description
-
- element :'media:rating', :as => :rating
- element :'media:rating', :value => :scheme, :as => :rating_scheme
-
+ # MediaRSS support, optional elements
element :'media:title', :as => :media_title
element :'media:keywords', :as => :media_keywords
+ element :'media:description', :as => :media_description
- element :'media:category', :as => :media_category
- element :'media:category', :value => :scheme, :as => :media_category_scheme
- element :'media:category', :value => :label, :as => :media_category_label
-
- element :'media:hash', :as => :media_hash
- element :'media:hash', :value => :algo, :as => :media_hash_algo
-
- element :'media:player', :value => :url, :as => :media_player_url
- element :'media:player', :value => :width, :as => :media_player_width
- element :'media:player', :value => :height, :as => :media_player_height
-
+ element :'media:thumbnail', :as => :media_thumbnail, :class => MRSSThumbnail
+ element :'media:rating', :as => :rating, :class => MRSSRating
+ element :'media:category', :as => :media_category, :class => MRSSCategory
+ element :'media:hash', :as => :media_hash, :class => MRSSHash
+ element :'media:player', :as => :media_player, :class => MRSSPlayer
elements :'media:credit', :as => :credits, :class => MRSSCredit
-
- element :'media:copyright', :as => :copyright
- element :'media:copyright', :as => :copyright_url, :value => :url
-
+ element :'media:copyright', :as => :copyright, :class => MRSSCopyright
element :'media:restriction', :as => :media_restriction, :class => MRSSRestriction
-
+ element :'media:text', :as => :text, :class => MRSSText
elements :'media:content', :as => :media_content, :class => MRSSContent
- element :'media:group', :as => :media_group, :class => MRSSGroup
-
- element :'media:text', :as => :media_text_type, :value => :type
- element :'media:text', :as => :media_text_lang, :value => :lang
- element :'media:text', :as => :media_text_start, :value => :start
- element :'media:text', :as => :media_text_end, :value => :end
- element :'media:text', :as => :media_text
+ elements :'media:group', :as => :media_groups, :class => MRSSGroup
# iTunes
element :'itunes:author', :as => :author
element :'itunes:block', :as => :itunes_block
element :'itunes:duration', :as => :duration