-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Summary
Add helper methods to easily extract media content and enclosures from feeds, especially useful for podcast and media-heavy feeds.
Proposed Features
enclosures
Extract all enclosures (commonly used in podcasts):
def enclosures
items.filter_map do |item|
# Check for standard enclosure tag
if item[:enclosure_url]
{
url: item[:enclosure_url],
type: item[:enclosure_type],
length: item[:enclosure_length],
item: item
}
end
end
endRequires adding enclosure tags:
SimpleRSS.item_tags << :'enclosure#url'
SimpleRSS.item_tags << :'enclosure#type'
SimpleRSS.item_tags << :'enclosure#length'images
Collect all image URLs from items:
def images
items.filter_map do |item|
item[:media_thumbnail_url] || item[:media_content_url]
end.compact.uniq
endItem-level helper
# Add to item hash via method_missing or explicit method
item.has_media?
item.media_url # Returns first available media URLAdditional Tags to Support
Consider adding these to default @@item_tags:
enclosure#url,enclosure#type,enclosure#lengthitunes:duration,itunes:image#hrefmedia:description
Benefits
- First-class podcast feed support
- Easy media extraction for feed readers
- Consistent interface across different media tag formats
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels