51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
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": "Jobs",
|
|
"description": "Combined Jobs Feed"
|
|
},
|
|
"sources" : [
|
|
{
|
|
/* "name" : "JobServe",*/
|
|
"count" : 100,
|
|
"feed_url" : "http://www.JobServe.com/MySearch/EDF47BEA6B31EF.rss"
|
|
},
|
|
{
|
|
/* "name" : "JobServe",*/
|
|
"count" : 100,
|
|
"feed_url" : "http://www.JobServe.com/MySearch/3CAD044BEF2BFA.rss"
|
|
},
|
|
{
|
|
/* "name" : "JobServe",*/
|
|
"count" : 100,
|
|
"feed_url" : "http://www.JobServe.com/MySearch/3CAD044BEF2BFA.rss"
|
|
}
|
|
]
|
|
};
|
|
var braider_options = {
|
|
feeds : feeds,
|
|
indent : " ",
|
|
date_sort_order : "desc", // Newest first
|
|
log_level : "debug"
|
|
};
|
|
var rss_braider = RssBraider.createClient(braider_options);
|
|
|
|
// Override logging level (debug, info, warn, err, off)
|
|
//rss_braider.logger.level('off');
|
|
|
|
// Output braided feed as rss. use 'json' for JSON output.
|
|
rss_braider.processFeed('simple_test_feed', 'rss', function(err, data){
|
|
// rss_braider.processFeed('simple_test_feed', 'json', function(err, data){
|
|
if (err) {
|
|
return console.log(err);
|
|
}
|
|
console.log(data);
|
|
}); |