diff options
author | Minteck <contact@minteck.org> | 2022-01-09 13:04:14 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-09 13:04:14 +0100 |
commit | dc65563df84d80bcc0970febef6a5f9a7759bdcb (patch) | |
tree | 683adf13430bce48c23e6928a3a2eb0b5614094a /update/infobox.js | |
parent | ad5950fb36d71b0f522ac3dab80983212cafee44 (diff) | |
download | ponyfind-dc65563df84d80bcc0970febef6a5f9a7759bdcb.tar.gz ponyfind-dc65563df84d80bcc0970febef6a5f9a7759bdcb.tar.bz2 ponyfind-dc65563df84d80bcc0970febef6a5f9a7759bdcb.zip |
smol update
Diffstat (limited to 'update/infobox.js')
-rw-r--r-- | update/infobox.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/update/infobox.js b/update/infobox.js index b9d2591..faaf943 100644 --- a/update/infobox.js +++ b/update/infobox.js @@ -14,7 +14,7 @@ console.log("Gathering infobox for each page..."); let mwextracts = (await axios.get("https://mlp.fandom.com/api.php?format=json&action=query&prop=extracts&exlimit=max&explaintext&exintro&titles=" + encodeURI(page.name) + "&redirects=")).data; let extracts = ""; try { - extracts = mwextracts.query.pages[Object.keys(mwextracts.query.pages)[0]].extract.replace(/(.*)\n\n(.*)/gm, "$2").replace(/([.?!])\s*(?=[A-Z])/g, "$1|").split("|")[0]; + extracts = mwextracts.query.pages[Object.keys(mwextracts.query.pages)[0]].extract.replace(/(.*)\n(.*)/, "$2").replace(/(.*)\n\n(.*)/gm, "$2").replace(/([.?!])\s*(?=[A-Z])/g, "$1|").split("|")[0]; } catch (e) { extracts = ""; } |