RSS
Reads RSS feed from given URL(s) and returns structured feed data with items and channel metadata.
Method Signature
RSS( urls, [filter], [maxItems], [itunes], [mediaRss], [userAgent], [timeout] )Arguments
urls
string or array
Yes
URL or Array of URLs to read RSS feed from. Can be http(s) URLs or local file paths (file:/path/to/file)
filter
function
No
A filter closure/lambda to filter feed items by certain criteria
(i) -> true
maxItems
numeric
No
Maximum number of items to return (0 = unlimited)
0
itunes
boolean
No
Parse iTunes podcast extensions
false
mediaRss
boolean
No
Parse Media RSS extensions for video/audio thumbnails
false
userAgent
string
No
Custom User-Agent string for HTTP requests
""
timeout
numeric
No
Timeout in seconds for HTTP requests
25
Examples
Basic RSS Feed Reading
// Read a simple RSS feed
feedData = RSS( "https://example.com/feed.xml" );
println( "Feed Title: " & feedData.channel.title );
println( "Found " & feedData.items.size() & " items" );
// Display first few items
feedData.items.each( ( item, index ) => {
if ( index <= 3 ) {
println( "- " & item.title );
println( " " & item.link );
}
} );Reading Multiple Feeds
Using Filters and Limits
Reading Podcast Feeds with iTunes Extensions
Reading Media RSS with Thumbnails
Custom HTTP Settings
Local File Reading
Return Value
The function returns a struct with two main keys:
items (Array)
items (Array)Array of feed items, each containing:
title- Item titlelink- Item URLdescription- Item description/contentpubDate- Publication dateauthor- Item authorcategories- Array of categoriesguid- Unique identifierAdditional fields based on feed type and extensions
channel (Struct)
channel (Struct)Feed metadata containing:
title- Feed titlelink- Feed URLdescription- Feed descriptionlanguage- Feed languagelastBuildDate- Last update dategenerator- Feed generator softwareAdditional fields based on feed type and extensions
iTunes Extension Fields
When itunes=true, additional fields are available:
Channel Fields:
itunesAuthor- Podcast authoritunesCategory- Podcast categoryitunesImage- Podcast artwork URLitunesExplicit- Explicit content flagitunesSubtitle- Podcast subtitle
Item Fields:
itunesAuthor- Episode authoritunesDuration- Episode durationitunesExplicit- Episode explicit flagitunesSummary- Episode summaryitunesTitle- Episode title
Media RSS Extension Fields
When mediaRss=true, additional fields are available:
Item Fields:
mediaThumbnailUrl- Thumbnail image URLmediaContentUrl- Media file URLmediaContentType- Media MIME typemediaPlayerUrl- Media player URL
Related
Feed Component - Full-featured component for reading and creating RSS/Atom feeds
Last updated
Was this helpful?
