3 lines
2.1 KiB
JavaScript
3 lines
2.1 KiB
JavaScript
|
var outputFile="tech",RssBraider=require("rss-braider"),fs=require("fs"),ejs=require("ejs"),read=require("fs").readFileSync,join=require("path").join,str=read(join(__dirname,"/templates/rss.ejs"),"utf8"),feeds={};feeds.simple_test_feed={feed_name:"feed",default_count:1,no_cdata_fields:[],meta:{title:"Technology",description:"Combined Tech Feed",site_url:"http://pipes.silvrtree.co.uk/tech.xml"},sources:[{count:100,feed_url:"http://feeds.feedburner.com/lenovoblogs/designmatters"},{count:100,feed_url:"http://www.engadget.com/rss.xml"},{count:100,feed_url:"http://www.computerweekly.com/rss/All-Computer-Weekly-content.xml"},{count:100,feed_url:"http://winsupersite.com/rss.xml"},{count:100,feed_url:"https://feeds.feedburner.com/TheGadgeteer"},{count:100,feed_url:"http://www.wired.com/category/gear/feed/"},{count:100,feed_url:"https://feeds2.feedburner.com/AndroidCommunity"},{count:100,feed_url:"https://feeds.feedburner.com/AndroidPolice"},{count:100,feed_url:"https://feeds.feedburner.com/AndroidPolice"},{count:100,feed_url:"https://feeds2.feedburner.com/PlanetAndroidCom"},{count:100,feed_url:"http://www.theverge.com/rss/frontpage"},{count:100,feed_url:"http://feed.androidauthority.com/"},{count:100,feed_url:"https://feeds.feedburner.com/codinghorror"}]};var braider_options={feeds:feeds,indent:" ",date_sort_order:"desc",log_level:"warn",dedupe_fields:["link","guid"]},rss_braider=RssBraider.createClient(braider_options);rss_braider.logger.level("off"),rss_braider.processFeed("simple_test_feed","json",function(e,t){if(e)return console.log(e);var s=JSON.parse(t),o=ejs.compile(str)(s);fs.writeFile(__dirname+"/html/"+outputFile+".html",o,function(e){return e?console.log(e):void console.log("The file was saved!")}),fs.writeFile(__dirname+"/html/"+outputFile+".json",t,function(e){return e?console.log(e):void console.log("The file was saved!")})}),rss_braider.processFeed("simple_test_feed","rss",function(e,t){return e?console.log(e):void fs.writeFile(__dirname+"/html/"+outputFile+".xml",t,function(e){return e?console.log(e):void console.log("The file was saved!")})});
|
||
|
//# sourceMappingURL=tech.min.js.map
|