From 8e2d68191e9d85f604969bb4110c9fbb0b553901 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 8 Apr 2021 18:52:03 +0200 Subject: [PATCH] Use process.env variable instead of a file --- .gitignore | 2 -- src/platforms/csetforetell-fetch.js | 4 +++- src/platforms/goodjudmentopen-fetch.js | 3 +++ src/platforms/hypermind-fetch.js | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9ccdca4..ead0f31 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,3 @@ node_modules/ possiblenewsources.md herokulocation.md - - diff --git a/src/platforms/csetforetell-fetch.js b/src/platforms/csetforetell-fetch.js index ff4ba01..d510680 100644 --- a/src/platforms/csetforetell-fetch.js +++ b/src/platforms/csetforetell-fetch.js @@ -12,6 +12,8 @@ let htmlEndPoint = 'https://www.cset-foretell.com/questions?page=' /* Support functions */ function getcookie(){ + return process.env.CSETFORETELL_COOKIE + /* try { let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let cookie = JSON.parse(rawcookie).csetforetellcookie @@ -23,7 +25,7 @@ function getcookie(){ } catch(error) { console.log("Error: No cookies for CSET-foretell on src/privatekeys.json! See the README.md") process.exit() - } + }*/ } diff --git a/src/platforms/goodjudmentopen-fetch.js b/src/platforms/goodjudmentopen-fetch.js index dea9911..cf8299d 100644 --- a/src/platforms/goodjudmentopen-fetch.js +++ b/src/platforms/goodjudmentopen-fetch.js @@ -12,6 +12,8 @@ let htmlEndPoint = 'https://www.gjopen.com/questions?page=' /* Support functions */ function getcookie() { + return process.env.GOODJUDGMENTOPENCOOKIE + /* try { let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let cookie = JSON.parse(rawcookie).goodjudmentopencookie @@ -24,6 +26,7 @@ function getcookie() { console.log("Error: No cookies for Good Judgment Open on src/privatekeys.json! See the README.md") process.exit() } + */ } diff --git a/src/platforms/hypermind-fetch.js b/src/platforms/hypermind-fetch.js index 1fbcb0e..734847f 100644 --- a/src/platforms/hypermind-fetch.js +++ b/src/platforms/hypermind-fetch.js @@ -14,6 +14,8 @@ function sleep(ms) { } function getcookie() { + return process.env.HYPERMINDCOOKIE + /* try { let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let cookie = JSON.parse(rawcookie).hypermindcookie @@ -25,6 +27,7 @@ function getcookie() { console.log("Error: No cookies for Hypermind on src/privatekeys.json! See the README.md") process.exit() } + */ } async function fetchHypermindData1(slug) {