aboutsummaryrefslogtreecommitdiff
path: root/update/pages.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-01-08 21:47:45 +0100
committerMinteck <contact@minteck.org>2022-01-08 21:47:45 +0100
commitbe6c790e43be36cfa6669110c7064a67ad3c4623 (patch)
tree3e81dd5a8caaf3f9c9db6b21f858167f01983119 /update/pages.js
parentac2dea4a23ca72001e41c1dbf66ff1a0d01e217c (diff)
downloadponyfind-be6c790e43be36cfa6669110c7064a67ad3c4623.tar.gz
ponyfind-be6c790e43be36cfa6669110c7064a67ad3c4623.tar.bz2
ponyfind-be6c790e43be36cfa6669110c7064a67ad3c4623.zip
Update
Diffstat (limited to 'update/pages.js')
-rw-r--r--update/pages.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/update/pages.js b/update/pages.js
index 8449ca5..7f3a1c8 100644
--- a/update/pages.js
+++ b/update/pages.js
@@ -1,13 +1,10 @@
const fs = require('fs');
const axios = require('axios');
-if (fs.existsSync("./data")) fs.rmSync("./data", { recursive: true });
-fs.mkdirSync("./data");
-
(async () => {
console.log("Gathering pages list...");
let pages = [];
- for (let page of JSON.parse(fs.readFileSync("list.json").toString())) {
+ for (let page of JSON.parse(fs.readFileSync("./data/list.json").toString())) {
console.log("Searching for '" + page + "'...");
try {
let data = (await axios.get("https://mlp.fandom.com/api.php?action=query&list=search&srsearch=" + encodeURI(page) + "&srlimit=1&srenablerewrites=true&format=json")).data;