From 6e76d564ab1a70b58fe63a2cadabda413d7e18ff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Jul 2015 13:52:34 +0100 Subject: [PATCH] Make the feeds generate json --- lifestyle.js | 8 ++++++++ paleo.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lifestyle.js b/lifestyle.js index 4021169..bf231c5 100644 --- a/lifestyle.js +++ b/lifestyle.js @@ -212,6 +212,14 @@ rss_braider.processFeed('simple_test_feed', 'json', function (err, data) { var j = JSON.parse(data); var ejsOutput = ejs.compile(str)(j); + fs.writeFile(__dirname + "/html/" + outputFile + ".json", data, function (err) { + if (err) { + return console.log(err); + } + + console.log("The file was saved!"); + }); + fs.writeFile(__dirname + "/html/" + outputFile + ".html", ejsOutput, function (err) { if (err) { diff --git a/paleo.js b/paleo.js index 6ca8cb1..d6fd807 100644 --- a/paleo.js +++ b/paleo.js @@ -86,6 +86,14 @@ rss_braider.processFeed('simple_test_feed', 'json', function (err, data) { var j = JSON.parse(data); var ejsOutput = ejs.compile(str)(j); + fs.writeFile(__dirname + "/html/" + outputFile + ".json", data, function (err) { + if (err) { + return console.log(err); + } + + console.log("The file was saved!"); + }); + fs.writeFile(__dirname + "/html/" + outputFile + ".html", ejsOutput, function (err) { if (err) {