diff --git a/src/inc/trigger/useless_huan.mjs b/src/inc/trigger/useless_huan.mjs index f246bdd..f4e8afe 100644 --- a/src/inc/trigger/useless_huan.mjs +++ b/src/inc/trigger/useless_huan.mjs @@ -1,9 +1,10 @@ import fetch from "flumm-fetch-cookies"; +import { parse } from "node-html-parser"; const apis = { launch: 'https://fdo.rocketlaunch.live/json/launches/next/1', fml: 'https://www.fmylife.com/random', - konfuzius: 'https://de.wikiquote.org/w/api.php?action=parse&format=json&pageid=155§ion=2', + konfuzius: 'https://www.careelite.de/konfuzius-zitate-weisheiten-sprueche/', }; @@ -56,17 +57,16 @@ export default async bot => { f: async e => { let res; try { - res = (await (await fetch(apis.konfuzius)).json()).parse.text['*']; + res = await (await fetch(apis.konfuzius)).text(); } catch(err) { console.error(err); } - const quotes = res - .replace(/(.+?)<\/a>/g, '$1') - .match(/