|
@@ -1,4 +1,15 @@
|
|
|
// const radiomanifest = require('radiomanifest.js')
|
|
|
+
|
|
|
+function updateNow(radio) {
|
|
|
+ var box = document.querySelector('#now-info')
|
|
|
+ const show = radio.getSchedule().getNowShow()
|
|
|
+ try {
|
|
|
+ var text = show.getName()
|
|
|
+ } catch (e) {
|
|
|
+ var text = String(show)
|
|
|
+ }
|
|
|
+ box.textContent = text
|
|
|
+}
|
|
|
async function fai () {
|
|
|
const radio = await radiomanifest.get('https://radiomanifest.degenerazione.xyz/v0.2/examples/full-ondarossa')
|
|
|
console.log('radio?', radio)
|
|
@@ -34,6 +45,10 @@ async function fai () {
|
|
|
const info = document.querySelector('#show-info')
|
|
|
info.textContent = radio.getShowByName(evt.target.dataset['show']).getFeed()
|
|
|
}, true)
|
|
|
+
|
|
|
+ updateNow(radio)
|
|
|
+ console.log(radio.getSchedule())
|
|
|
+ setInterval(function() { updateNow(radio) }, 2000)
|
|
|
}
|
|
|
|
|
|
fai()
|