From f08f57ed72d6d01d53fdb9c410f03e4d6c4e9afc Mon Sep 17 00:00:00 2001 From: Kip Gebhardt Date: Thu, 28 May 2015 18:01:47 -0700 Subject: [PATCH] Update README.md --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7ee507..5e1ba16 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,30 @@ npm install rss-braider ## Examples ``` $ cd examples -$ node simple.js -$ node plugins.js +$ node simple.js (combines 3 sources) +$ node plugins.js (combines 3 sources and runs a transformation plugin) +``` +## Code Example +```js +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); +}); ``` +