"readme":"[![Build Status](https://travis-ci.org/KQED/rss-braider.svg?branch=master)](https://travis-ci.org/KQED/rss-braider)\n\n## Summary\nBraid/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\n\n## Installation\n```\nnpm install rss-braider\n```\n## Test\n`npm test`\n\n## Examples\n```\n$ cd examples\n$ node simple.js (combines 3 sources)\n$ node plugins.js (combines 3 sources and runs a transformation plugin)\n```\n### Code Example\n```js\nvar RssBraider = require('rss-braider'),\n feeds = {};\n\n// Pull feeds from config files:\n// feeds.simple_test_feed = require(\"./config/feed\").feed;\n// Or define in-line\nfeeds.simple_test_feed = {\n \"feed_name\" : \"feed\",\n \"default_count\" : 1,\n \"no_cdata_fields\" : [], // Don't wrap these fields in CDATA tags\n \"meta\" : {\n \"title\": \"NPR Braided Feed\",\n \"description\": \"This is a test of two NPR\"\n },\n \"sources\" : [\n {\n \"name\" : \"NPR Headlines\",\n \"count\" : 2,\n \"feed_url\" : \"http://www.npr.org/rss/rss.php?id=1001\",\n },\n {\n \"name\" : \"NPR Sports\",\n \"count\" : 2,\n \"feed_url\" : \"http://www.npr.org/rss/rss.php?id=1055\"\n }\n ]\n};\nvar braider_options = {\n feeds : feeds,\n indent : \" \",\n date_sort_order : \"desc\", // Newest first\n log_level : \"debug\"\n};\nvar rss_braider = RssBraider.createClient(braider_options);\n\n// Override logging level (debug, info, warn, err, off)\nrss_braider.logger.level('off');\n\n// Output braided feed as rss. use 'json' for JSON output.\nrss_braider.processFeed('simple_test_feed', 'rss', function(err, data){\n if (err) {\n return console.log(err);\n }\n console.log(data);\n});\n```\n## Plugins\nPlugins provide custom manipulation and filtering of RSS items/articles. See `examples/plugins` for examples.\n\nA plugin operates by modifying the `itemOptions` object or by returning `null` which will exclude the `item` (article) from the resulting feed (See `examples/plugins/filter_out_all_articles.js`).\n\nThe `itemsOptions` object gets passed to `node-rss` to generate the RSS feeds, so read the documentation on that module and its use of custom namespaces. (https://github.com/dylang/node-rss)\n\n### Plugin Example\nThis plugin will capitalize the article title for all articles\n```js\nmodule.exports = function (item, itemOptions, source) {\n if (!item || !itemOptions) {\n return;\n }\n\n if (itemOptions.title) {\n itemOptions.title = itemOptions.title.toUpperCase();\n }\n\n return itemOptions;\n};\n```\n\nThe plugin is registered with the feed in the feed config .js file and are run in order.\n```js\nvar feed = {\n \"feed_name\" : \"feed with plugins\",\n \"default_count\" : 1,\n \"plugins\" : ['capitalize_title', 'plugin_template'],\n...\n```\n\n## Release Notes\n### 1.0.0\nChanged plugin architecture to allow filtering out of article/items by returning `-1` instead of a modified `itemsOptions` object. This is a breaking change as it will require existing plugins to return `itemsOptions` instead of modifying the reference. See `examples/plugins`.\n\n",