Merge RSS 2.0 feed(s) into a feed.
$ npm install feedmix
var feedmix = require('feedmix');
var fs = require('fs');
var a = fs.readFileSync('a.rss', utf8');
var b = fs.readFileSync('b.rss', utf8');
var c = fs.readFileSync('c.rss', utf8');
var m = feedmix.merge([a, b, c], {
trim: true
});
// do something with `m`
console.log(feedmix.stringify(m, {
xmldec: {
version: '1.0',
encoding: 'UTF-8'
}
}));
This merges b.rss
and c.rss
into a.rss
. All items are sorted, and
lastBuildDate
element will be updated.
Also, You can pass xml2js’s parser options to merge()
and builder
options to stringify()
.