misc.anonradio: hopefully fix bad titles from bad json formatting on icecast's end

This commit is contained in:
Cynthia Foxwell 2022-08-19 22:53:14 -06:00
parent fe7d7b86d3
commit 947a7baa44
1 changed files with 3 additions and 3 deletions

View File

@ -281,9 +281,9 @@ anonradio.callback = async function (msg, line) {
const schedule = await fetch("https://anonradio.net/schedule/").then((res) =>
res.text()
);
const icecast = await fetch("http://anonradio.net:8010/status-json.xsl").then(
(res) => res.json()
);
const icecast = await fetch("http://anonradio.net:8010/status-json.xsl")
.then((res) => res.text())
.then((data) => JSON.parse(data.replace(/"title":-,/g, '"title":"-",')));
let lines = schedule.split("\n");
lines = lines.slice(4, lines.length - 2);