An easy way to have a 24/7 audio stream of music.

Better fetch of the title in case there's multiple sources

Changed files
+9 -7
+9 -7
status.xsl
···
}
function s () {
-
fetch('https://radio.rita.moe/status-json.xsl')
-
.then(r => r.json())
-
.then(j => {
-
setTimeout(_ => {
-
document.querySelector('[data-mount="/music"] .playing').innerHTML = j.icestats.source.title
-
}, 5000)
-
})
+
document.querySelectorAll('div[data-mount]').forEach(e => {
+
fetch('https://radio.rita.moe/status-json.xsl?mount=' + e.dataset.mount)
+
.then(r => r.json())
+
.then(j => {
+
setTimeout(_ => {
+
e.querySelector('.playing').innerHTML = j.icestats.source.title
+
}, 5000)
+
})
+
})
}
setInterval(s, 3000)