-
-
Notifications
You must be signed in to change notification settings - Fork 2
Multiple Feeds Retrieval Methods
If you wish to fetch more than a single feed and have it merged (or mashed) into a single master feed for display, then that is not a problem with ColdBox. Instead of supplying a single URL to the feedURL argument, you can supply a list of URLs. The feedReader will merge all the listed feeds together, reorder their items by the date published and output the results like a standard single feed. It doesn't even matter what format the feeds are, you can fetch and merge Atom, RSS and RDF feeds together.
In the simple example below 2 RSS and 1 Atom feed are being processed into a single feed. This feed will only display 10 times that will be in a query format.
<cfset rc.feed1 = "http://www.example.com/feeds/atom">
<cfset rc.feed2 = "http://www.example.org/news/rss.xml">
<cfset rc.feed3 = "http://www.example.org/siteupdates/rss.xml">
<cfset rc.myFeed = getPlugin("feedReader").retrieveFeed(feedURL="#rc.feed1#,#rc.feed2#,#rc.feed3#",itemsType="query",maxItems=10)>
The only down side to merging feeds is that some conflicting feed data will be dropped. The tags Author, Description, Image, Rating, Rights, OpenSearch will return empty values. Also obviously fetching and combining multiple feeds will require more processing time than a single feed.
- Feed Reader * [RSS Syndication Format](https://github.com/ColdBox/cbox-feeds/wiki/RSS Syndication Format) * RDF Syndication Format * Atom Syndication Format * Supported Syntax and Formats
- Feed Generator
- Feed Generator Elements