Use process.env variable instead of a file

This commit is contained in:
NunoSempere 2021-04-08 18:52:03 +02:00
parent 799a683d88
commit 8e2d68191e
4 changed files with 9 additions and 3 deletions

2
.gitignore vendored
View File

@ -5,5 +5,3 @@ node_modules/
possiblenewsources.md possiblenewsources.md
herokulocation.md herokulocation.md

View File

@ -12,6 +12,8 @@ let htmlEndPoint = 'https://www.cset-foretell.com/questions?page='
/* Support functions */ /* Support functions */
function getcookie(){ function getcookie(){
return process.env.CSETFORETELL_COOKIE
/*
try { try {
let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let rawcookie = fs.readFileSync("./src/input/privatekeys.json")
let cookie = JSON.parse(rawcookie).csetforetellcookie let cookie = JSON.parse(rawcookie).csetforetellcookie
@ -23,7 +25,7 @@ function getcookie(){
} catch(error) { } catch(error) {
console.log("Error: No cookies for CSET-foretell on src/privatekeys.json! See the README.md") console.log("Error: No cookies for CSET-foretell on src/privatekeys.json! See the README.md")
process.exit() process.exit()
} }*/
} }

View File

@ -12,6 +12,8 @@ let htmlEndPoint = 'https://www.gjopen.com/questions?page='
/* Support functions */ /* Support functions */
function getcookie() { function getcookie() {
return process.env.GOODJUDGMENTOPENCOOKIE
/*
try { try {
let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let rawcookie = fs.readFileSync("./src/input/privatekeys.json")
let cookie = JSON.parse(rawcookie).goodjudmentopencookie 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") console.log("Error: No cookies for Good Judgment Open on src/privatekeys.json! See the README.md")
process.exit() process.exit()
} }
*/
} }

View File

@ -14,6 +14,8 @@ function sleep(ms) {
} }
function getcookie() { function getcookie() {
return process.env.HYPERMINDCOOKIE
/*
try { try {
let rawcookie = fs.readFileSync("./src/input/privatekeys.json") let rawcookie = fs.readFileSync("./src/input/privatekeys.json")
let cookie = JSON.parse(rawcookie).hypermindcookie 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") console.log("Error: No cookies for Hypermind on src/privatekeys.json! See the README.md")
process.exit() process.exit()
} }
*/
} }
async function fetchHypermindData1(slug) { async function fetchHypermindData1(slug) {