mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-02-10 23:29:15 +00:00
Update README.md
This commit is contained in:
parent
4f481552b7
commit
f08f57ed72
27
README.md
27
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);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user