Go to file
2015-06-11 14:52:38 -07:00
examples comment cleanup 2015-06-11 14:52:38 -07:00
lib RSS-26: Adding unit test for filtering all articles 2015-06-11 14:28:57 -07:00
test comment cleanup 2015-06-11 14:52:38 -07:00
.gitignore More cleanup 2015-05-29 11:40:33 -07:00
.travis.yml Removing ancient node versions. 2015-02-11 08:24:53 -08:00
index.js first commit of new repo 2014-12-23 15:39:57 -08:00
package.json RSS-26: Adding unit test for filtering all articles 2015-06-11 14:28:57 -07:00
README.md More cleanud and documentation 2015-05-28 18:18:07 -07:00

Build Status

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. Automatic deduplication

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'),
    feeds = {};

// Pull feeds from config files:
//      feeds.simple_test_feed = require("./config/feed").feed;
// Or define in-line
feeds.simple_test_feed = {
    "feed_name"             : "feed",
    "default_count"         : 1,
    "no_cdata_fields"       : [], // Don't wrap these fields in CDATA tags
    "meta" : {
        "title": "NPR Braided Feed",
        "description": "This is a test of two NPR"
    },
    "sources" : [
        {
            "name"              : "NPR Headlines",
            "count"             : 2,
            "feed_url"          : "http://www.npr.org/rss/rss.php?id=1001",
        },
        {
            "name"              : "NPR Sports",
            "count"             : 2,
            "feed_url"          : "http://www.npr.org/rss/rss.php?id=1055"
        }
    ]
};
var braider_options = {
    feeds           : feeds,
    indent          : "    ",
    date_sort_order : "desc" // Newest first
};
var rss_braider = RssBraider.createClient(braider_options);

// Output braided feed as rss. use 'json' for JSON output.
rss_braider.processFeed('simple_test_feed', 'rss', function(err, data){
    if (err) {
        return console.log(err);
    }
    console.log(data);
});