Home CanadaElephant cage with Klein. Ally. Show.

Elephant cage with Klein. Ally. Show.

by OmarAli
Elephant cage with Klein. Ally. Show.

Search and navigation by sections

Unite

Ask for your smart speaker
play One Oh Six Point Seven K Rock on Courage

${localTime}

`; return row; } function buildScheduleRow(show,stationTimezone) { const row = document.createElement(“a”); row.href = `row.className = “player-item”; const startIso = show.startDateTime; const endIso = show.endDateTime; const startDayLocal = getLocalDateInTimezone(startIso,stationTimezone); const endDayLocal = getLocalDateInTimezone(endIso,stationTimezone); const TodayLocal = getTodayInTimezone(stationTimezone); let label = formatTime(startIso, StationTimezone); if (show.isOnNow) { label = “Now on air”; } else if (startDayLocal !== TodayLocal && endDayLocal === TodayLocal) { label = `Until ${formatTime(endIso, StationTimezone)}`; } row.innerHTML = `
${show.showTitle || ''}

${formatTime(startIso,stationTimezone)}

`; return row; } const isNumericValue = (value) => { return value of type === “string” ? value.trim() !== “” && !isNaN(Number(value.trim())) : typeof value === “number” && !isNaN(value); }; asynchronous function loadMusicBar() { let apiUrl = ` if(isNumericValue(awId)){ //now_playing_api apiUrl=` console.log(apiUrl); } Try { const res = await fetch(apiUrl); const data = await res.json(); window. Performances = data?. Performances || (); document.dispatchEvent(new Event(‘dispatch:ready’)); if (!window. Performances.length) return; const first = window. Performances(0); currentTrackEl.textContent = `${first.artist} – ${first.title}`; if (dropdownTitleEl) dropdownTitleEl.textContent = “Recently Played”; listEl.innerHTML = “”; window. Performances.slice(0, 20).forEach(item => { listEl.appendChild(buildMusicRow(item)); }); playerBar.classList.remove(“hidden”); } catch (err) { console.error(“Playback API error:”, err); } } Asynchronous function loadScheduleBar() {const baseDate = new Date(); const startWindow = new Date(baseDate); const endWindow = new Date(baseDate); startWindow.setDate(baseDate.getDate() – 1); endWindow.setDate(baseDate.getDate() + 2); const startDateStr = formatDate(startWindow); const endDateStr = formatDate(endWindow); const apiUrl = `try {const res = await fetch(apiUrl); const data = await res.json(); constant occurrences = data?.occurrences || (); if (!occurrences.length) return; conststationTimezone = occurrences(0).timezone || time zone || “UTC”; const TodayLocal = getTodayInTimezone(stationTimezone); const TodaysShows = occurrences .filter(show => { const startDayLocal = getLocalDateInTimezone(show.startDateTime, StationTimezone); const endDayLocal = getLocalDateInTimezone(show.endDateTime, StationTimezone); return startDayLocal === TodayLocal || endDayLocal === TodayLocal; }) .sort((a, b) => new date(a.startDateTime) – new date(b.startDateTime)); if (!todaysShows.length) return; const currentShow = TodaysShows.find(show => show.isOnNow) || TodaysShows.find(show => { const now = Date.now(); return new Date(show.startDateTime).getTime() <= now && new Date(show.endDateTime).getTime() > Now; }) || today’s shows (0); currentTrackEl.textContent = currentShow.showTitle || “”; if (dropdownTitleEl) dropdownTitleEl.textContent = “Schedule for today”; listEl.innerHTML = “”; TodaysShows.slice(0, 20).forEach(show => { listEl.appendChild(buildScheduleRow(show,stationTimezone)); }); playerBar.classList.remove(“hidden”); } catch (err) { console.error(“Schedule API error:”, err); } } if (stationType === “music”) { loadMusicBar(); } else if (stationType === “sports” || StationType === “news”) { loadScheduleBar(); } const playerContent = document.querySelector(“.player-content”); if (playerContent) { playerContent.addEventListener(“click”, function () { playerContent.classList.toggle(“visible”); }); } });

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More