From c8b1e3d28d7443387869272d9b465ddc18a8c427 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 8 Apr 2021 19:32:44 +0200 Subject: [PATCH] created a replaceAll method for strings --- src/platforms/csetforetell-fetch.js | 1 + src/platforms/goodjudgment-fetch.js | 1 + src/platforms/hypermind-fetch.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/platforms/csetforetell-fetch.js b/src/platforms/csetforetell-fetch.js index 31ab493..4750ea4 100644 --- a/src/platforms/csetforetell-fetch.js +++ b/src/platforms/csetforetell-fetch.js @@ -8,6 +8,7 @@ import {upsert} from "../utils/mongo-wrapper.js" /* Definitions */ let htmlEndPoint = 'https://www.cset-foretell.com/questions?page=' +String.prototype.replaceAll = function replaceAll(search, replace) { return this.split(search).join(replace); } /* Support functions */ diff --git a/src/platforms/goodjudgment-fetch.js b/src/platforms/goodjudgment-fetch.js index c03c8f6..064581a 100644 --- a/src/platforms/goodjudgment-fetch.js +++ b/src/platforms/goodjudgment-fetch.js @@ -8,6 +8,7 @@ import { upsert } from "../utils/mongo-wrapper.js" /* Definitions */ let endpoints = ["https://goodjudgment.io/superforecasts/", "https://goodjudgment.io/economist/"] +String.prototype.replaceAll = function replaceAll(search, replace) { return this.split(search).join(replace); } /* Support functions */ diff --git a/src/platforms/hypermind-fetch.js b/src/platforms/hypermind-fetch.js index 734847f..a41f7af 100644 --- a/src/platforms/hypermind-fetch.js +++ b/src/platforms/hypermind-fetch.js @@ -7,6 +7,7 @@ import { upsert } from "../utils/mongo-wrapper.js" /* Definitions */ let hypermindEnpoint1 = 'https://predict.hypermind.com/dash/jsx.json' +String.prototype.replaceAll = function replaceAll(search, replace) { return this.split(search).join(replace); } /* Support Functions */ function sleep(ms) {