I am trying to find a way of reading multiple RSS feeds, merging them together and sorting them by date. The feeds could be from anywhere / of any type, e.g. atom 0.3, atom 1.0, RSS 1.0, RSS 2.0, etc.
This page http://dawoe.blogspot.com/2008/03/transforming-feedsone-xslt-to-rule-them.html was extremely useful in terms of reading / handling the different types of feed - however it doesn't handle sorting the resulting data. Could "drawLinks" be updated to create a "temporary" XML file which could then be sorted?
When you wrap the templates in a variable, you could create an in-memory nodeset, over which you could sort and iterate. Each template would, like in your second linked example, create the same output for each differing feed.
So where it now says (in your first link) "<xsl:copy-of select='umbraco.library:GetDocumentByURL…'/>" you would first transform each feed to some general representation on which you could sort. How you could create multiple matching templates for each differing type is explained in your second linked article.
When you use Yahoo pipes and don't want to go over the usage limit, you can cache the results of "umbraco.library:GetDocumentByUrl()" using the second argument of that function in seconds (e.g. "umbraco.library:GetDocumentByUrl('http://domain/feed', 900)" for 15 minutes). It's a good idea in any scenario not to fetch the feed for every request you get on your site, as it may slowdown the end-user experience (while your server is waiting on someone else's server).
Merge and Sort different types of RSS feed
I am trying to find a way of reading multiple RSS feeds, merging them together and sorting them by date. The feeds could be from anywhere / of any type, e.g. atom 0.3, atom 1.0, RSS 1.0, RSS 2.0, etc.
I have seen this http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/reading-rss-feeds,-aggregating-and-sorting but it (seems to) assume the feeds are of the same type as "pubDate" is RSS. atom feeds use "issued" and "modified".
This page http://dawoe.blogspot.com/2008/03/transforming-feedsone-xslt-to-rule-them.html was extremely useful in terms of reading / handling the different types of feed - however it doesn't handle sorting the resulting data. Could "drawLinks" be updated to create a "temporary" XML file which could then be sorted?
When you wrap the templates in a variable, you could create an in-memory nodeset, over which you could sort and iterate. Each template would, like in your second linked example, create the same output for each differing feed.
So where it now says (in your first link) "<xsl:copy-of select='umbraco.library:GetDocumentByURL…'/>" you would first transform each feed to some general representation on which you could sort. How you could create multiple matching templates for each differing type is explained in your second linked article.
you can do some nice things with yahoo pipes too :-)
That's pretty clever @Bart de Jonge!
When you use Yahoo pipes and don't want to go over the usage limit, you can cache the results of "umbraco.library:GetDocumentByUrl()" using the second argument of that function in seconds (e.g. "umbraco.library:GetDocumentByUrl('http://domain/feed', 900)" for 15 minutes). It's a good idea in any scenario not to fetch the feed for every request you get on your site, as it may slowdown the end-user experience (while your server is waiting on someone else's server).
@thijs - see Feed Cache in the projects section.
is working on a reply...