From 255af85b3999b87e468d6bd13c6d52a32fcf2a9d Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 13 Aug 2021 18:23:58 +0200 Subject: [PATCH] fix: Fix js memory/garbage collecting problems by not fetching as much information in the 1st place. Turns out that the Hypermind request just has a parameter I can switch. --- src/platforms/hypermind-fetch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/hypermind-fetch.js b/src/platforms/hypermind-fetch.js index a1adf8f..3ba5e57 100644 --- a/src/platforms/hypermind-fetch.js +++ b/src/platforms/hypermind-fetch.js @@ -61,7 +61,7 @@ async function fetchHypermindDataShowcases(slug, cookie) { //"Cookie": cookie }, "referrer": "https://prod.hypermind.com/ngdp/en/showcase/showcase.html?inFrame=true", - "data": `[["showcase","getShowcase",{"showcase":"${slug}","fmt":{"fcsterCnt":true,"crowdFcst":true,"crowdFcstHist":true}}]]`, + "data": `[["showcase","getShowcase",{"showcase":"${slug}","fmt":{"fcsterCnt":true,"crowdFcst":true,"crowdFcstHist":false}}]]`, "method": "POST", "mode": "cors", httpsAgent: insecureHttpsAgent @@ -70,7 +70,7 @@ async function fetchHypermindDataShowcases(slug, cookie) { .then(items => items.map(item => item.IFP)) // console.log(response) - response.forEach(item => delete item.crowdFcstHist) + // response.forEach(item => delete item.crowdFcstHist) return response } @@ -167,7 +167,7 @@ async function hypermind_inner(cookie) { } } // console.log(resultsTotal) - console.log(resultsTotalUnique) + // console.log(resultsTotalUnique) console.log(resultsTotalUnique.length, "results") // let string = JSON.stringify(resultsTotalUnique, null, 2) // fs.writeFileSync('./data/hypermind-questions.json', string);