Rinser/lifestyle.js

123 lines
4.2 KiB
JavaScript
Raw Normal View History

2015-07-20 15:56:35 +00:00
var RssBraider = require('rss-braider'), fs = require('fs'),
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": "Lifestyle",
"description": "Combined Lifestyle Feed",
'site_url':'http://pipes.silvrtree.co.uk/lifestyle.xml'
},
"sources" : [
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://feeds2.feedburner.com/acquire"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://approachanxiety.com/?feed=atom"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.arenamagazine.co.uk/?feed=rss2"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://cgi.askmen.com/RSS/askmenRSS_channel.php?ID=fashion"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://cgi.askmen.com/RSS/askmenRSS_channel.php?ID=fine_living"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://cgi.askmen.com/RSS/askmenRSS_channel.php?ID=money"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://feeds.feedburner.com/BetterGuyX"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.ceostylefile.com/my_weblog/atom.xml"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.dmarge.com/feeds/posts/default"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.esquire.com/rss/"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://feeds.feedburner.com/gearpatrol"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://feeds.men.style.com/menstyle_gqeditors"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://iluwfashion.blogspot.com/feeds/posts/default"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://iluwfashion.blogspot.com/feeds/posts/default"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.getkempt.com/rss.xml"
}
]
};
var braider_options = {
feeds : feeds,
indent : " ",
date_sort_order : "desc", // Newest first
log_level : "warn"
};
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);
fs.writeFile(__dirname + "/html/lifestyle.xml", data, function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
});