mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-01-28 22:56:17 +00:00
1.0 KiB
1.0 KiB
Summary
Braid/aggregate one or more RSS feeds (file or url) into a single feed (RSS or JSON output). Process resulting feed through specified plugins.
Installation
npm install rss-braider
Test
npm test
Examples
$ cd examples
$ node simple.js (combines 3 sources)
$ node plugins.js (combines 3 sources and runs a transformation plugin)
Code Example
var RssBraider = require('rss-braider'),
feed_obj = {};
// Build feed options
feed_obj.filefeed = require("./config/feed").feed;
var braider_options = {
feeds : feed_obj,
indent : " ",
date_sort_order : "desc" // Newest first
};
var rss_braider = RssBraider.createClient(braider_options);
// braid 'filefeed' sources together and output in RSS format
rss_braider.processFeed('filefeed', 'rss', function(err, data){
if (err) {
return console.log(err);
}
console.log(data);
});