diff --git a/index.html b/index.html
index 82e1779..0a073b5 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,7 @@
@@ -11,11 +11,11 @@
diff --git a/ui.js b/ui.js
index b336f99..55d023d 100644
--- a/ui.js
+++ b/ui.js
@@ -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()