Ten @ 10-Aerei, treni e automobili -26/05/23 – 97.1fm The Drive – WDRV Chicago (2023)

Dieci alle 10

Di 97.1FM L'unità |

Dieci @ 10-Aerei, treni e automobili -5/26/23

Ten @ 10-Aerei, treni e automobili -26/05/23 – 97.1fm The Drive – WDRV Chicago (1)

Ten @ 10 Sondaggio Aerei, treni e automobili 5.26.23

Ricompense per l'ascolto

Visualizza altri premi

Leader in ascolto

Oggi Questa settimana Sempre
ASCOLTA ADESSO

'; this.div = document.querySelectorAll(this.divSelector)[0]; this.div.appendChild(html); }; this.removeUrlProtocol = function(url) { var newstr = url.replace('http://', ​​'//'); return newstr; }; // sottoscrivi gli eventi this.subscribeEvents = function() { var _this = this; for (var i in this.configChannels) { var channelName = this.configChannels[i]; var channel = this.pusher.subscribe(channelName); for (var j in this.events) { var eventName = this.events[j]; channel.bind(eventName, function(data) { _this.pusherEvent(channelName, eventName, data); }); } _this.channels.push(canale); } }; // elabora l'evento `cue` in tempo reale da Pusher.com this.pusherEvent = function(channelName, eventName, pusherData) { this.processTrack(pusherData); }; // prende l'ultima traccia dall'API this.ajaxLatestTrack = function() { var endpoint = this.endpoint + '/hll_widget_nowplaying_cues.php'; var data = { 'limite': '1' }; var _this = questo; var httpRequest = nuovo XMLHttpRequest(); httpRequest.open('POST', endpoint); httpRequest.setRequestHeader("Content-type", "application/json"); httpRequest.send(JSON.stringify(data)); httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { var json = JSON.parse(httpRequest.responseText); _this.processTrack(json.data.response[0]); } } }; // elabora i dati della traccia e aggiorna l'HTML this.processTrack = function(d) { var trackId = d.data.musicbrainz_recording;var type = d.type;var artist = d.data.artist || '';var trackName = d.data.description || '';var art = this.removeUrlProtocol(d.data.art_url || "https://wdrv.com/wp-content/plugins/hbi-player-widgets//assets/img/track.png");art = art + '?ver=2';// soluzione alternativa: ignora gli spot per oraif (type !== 'song') {return;} this.div.querySelectorAll('.artist .details')[0].innerHTML = artista; this.div.querySelectorAll('.track .details')[0].innerHTML = trackName; this.div.getElementsByClassName('album-art-img')[0].src = arte; }; // prende l'ultima traccia dall'API this.ajaxLatestEvents = function() { var endpoint = this.endpoint + '/hll_widget_livebar_events.php'; var dati = { limite: 1 }; var _this = questo; var httpRequest = nuovo XMLHttpRequest(); httpRequest.open('POST', endpoint); httpRequest.setRequestHeader("Content-type", "application/json"); httpRequest.send(JSON.stringify(data)); httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { var json = JSON.parse(httpRequest.responseText); _this.processEvent(json.data.response[0]); } } }; // elabora i dati della traccia e aggiorna l'HTML this.processEvent = function(element) { var obj = {}; obj.eventId = element.id; obj.title = element.name || ''; obj.foto = elemento.foto || "https://wdrv.com/wp-content/plugins/hbi-player-widgets//assets/img/event.png"; obj.formatStartTime = moment(element.start_date).format('h:mma'); obj.startTime = element.start_date; obj.endTime = elemento.end_date; obj.timeRange = function() { let start_date = moment(element.start_date); let end_date = moment(elemento.end_date); let default_format = 'h:mma'; let start_day_format = (default_format); let end_day_format = (default_format); // Se le date di inizio e di fine cadono entrambe in AM o PM, sii breve // ​​Esempio: 10:00-11:00 vs 10:00-11:00 if(start_date.format('a') === end_date .format('a')) { start_day_format = 'h:mm'; } // Rimuovi i minuti se 00 if(start_date.minutes() == 0) { start_day_format = 'h'; } if(end_date.minutes() == 0) { end_day_format = 'ha'; } return start_date.format(start_day_format) + "-" + end_date.format(end_day_format); }; this.div.querySelectorAll('.artist .details')[0].innerHTML = obj.timeRange(); this.div.querySelectorAll('.track .details')[0].innerHTML = obj.title; this.div.getElementsByClassName('album-art-img')[0].src = obj.photo; // Avvia il timer this.setEventTimer(); }; // Imposta il timer per l'aggiornamento dell'evento this.setEventTimer = function() { var _this = this; setTimeout(function(){ _this.ajaxLatestEvents(); }, this.eventRefreshTime); }; // prende le ultime ricompense this.ajaxLatestRewards = function() { var endpoint = this.endpoint + '/hll_widget_nowplaying_rewards.php'; var dati = {}; var _this = questo; var httpRequest = nuovo XMLHttpRequest(); httpRequest.open('POST', endpoint); httpRequest.setRequestHeader("Content-type", "application/json"); httpRequest.send(JSON.stringify(data)); httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { var json = JSON.parse(httpRequest.responseText); _this.processRewards(json.data); } } }; // elabora la ricompensa dell'evento e aggiorna l'HTML this.processRewards = function(d) { var _this = this; // rimuove quelli che non dovrebbero essere mostrati var d = d.filter(function(x) { if(x.in_widgets === true) { return true; } return false; }); // ordina in modo casuale l'array di ricompense var d = d.sort(function(a, b){return 0.5 - Math.random()}); // poi ordina le ricompense in primo piano d.sort(function(x) { return x.featured === false; }); variabile io = 0; for(i in d) { if(i > 1) { break; } // proprietà della ricompensa var rewardObject = d[i]; var id = ricompensaOggetto.id; var titolo = ricompensaOggetto.titolo; var image = this.removeUrlProtocol(rewardObject.photo); var tipo = ricompensaOggetto.tipo; var ore = Math.floor(rewardObject.hours / 3600); var oreLabel = ore == 1 ? 'ora' : 'ore'; if(type == 'geolocalizzazione') {type = 'app'; } // elemento var rewardElement = this.div.getElementsByClassName('reward-'+i)[0]; rewardElement.getElementsByClassName('img')[0].getElementsByTagName('img')[0].src = immagine; rewardElement.getElementsByClassName('content')[0].getElementsByClassName('details')[0].innerHTML = title; if(ore > 0) { rewardElement.getElementsByClassName('content')[0].getElementsByClassName('info')[0].getElementsByClassName('time')[0].innerHTML = hours + ' ' + hoursLabel; } rewardElement.getElementsByClassName('reward-featured-url')[0].setAttribute('href',"https://live.wdrv.com/listen/rewards/" + id + "/?utm_source=station-website&utm_medium =widget&utm_campaign=in riproduzione"); // premio tipo badge var typeBadge = rewardElement.getElementsByClassName('content')[0].getElementsByClassName('info')[0].getElementsByClassName('type-badge')[0]; var typeBadgeclassListAsArray = new Array(typeBadge.classList.length); for (var j = 0, len = typeBadge.classList.length; j < len; j++) { typeBadgeclassListAsArray[j] = typeBadge.classList[j]; } typeBadgeclassListAsArray.forEach(function(className) { typeBadge.classList.remove(className); }); // Etichetta badge personalizzata var badgeLabel = type; if (badgeLabel === 'app' || badgeLabel === 'qrcode' || badgeLabel === 'geolocalizzazione') { badgeLabel = 'app'; } if (badgeLabel === 'smartspeaker') { badgeLabel = 'alexa'; } if (badgeLabel === 'codice promozionale') { badgeLabel = 'codice promozionale'; } typeBadge.innerHTML = badgeLabel; typeBadge.classList.add('type-badge','reward-type-'+type); // mostra l'elemento premio rewardElement.classList.remove("hide"); io++; } // Se i premi sono disponibili, mostra il wrapper if(d && d.length > 0) { var rewardsWrapper = this.div.getElementsByClassName('rewards-wrapper')[0]; rewardsWrapper.classList.remove("nascondi"); } // Avvia il timer this.setRewardsTimer(); }; // Imposta il timer per i premi refresh this.setRewardsTimer = function() { var _this = this; setTimeout(function(){ _this.ajaxLatestRewards(); }, this.rewardsRefreshTime); }; // prende gli ultimi dati di ascolto dell'utente this.ajaxLatestListeners = function() { var endpoint = this.endpoint + '/hll_widget_nowplaying_listeners.php'; var data = { 'limite': this.listenerCount }; var _this = questo; var httpRequest = nuovo XMLHttpRequest(); httpRequest.open('POST', endpoint); httpRequest.setRequestHeader("Content-type", "application/json"); httpRequest.send(JSON.stringify(data)); httpRequest.onreadystatechange = function () { if (httpRequest.readyState == 4 && httpRequest.status == 200) { var json = JSON.parse(httpRequest.responseText); _this.processListeners(json.data[0]); } } }; // elabora i dati della traccia e aggiorna l'HTML this.processListeners = function(d) { // elemento principale var section = this.div.getElementsByClassName('types-sections')[0]; // Passa attraverso ogni tipo for(x in d) { var type = x; var tipoDati = d[x]; var typeElement = section.getElementsByClassName('type-section ' + type)[0]; if(!typeElement) { continua; } // Passa attraverso ogni listener solo un certo numero di volte var listenerElements = []; variabile io = 0; for(i in typeData) { if(i > this.listenerCount - 1) { break; } // Dati del listener var listener = typeData[i]; var firstName = listener.first_name; var lastName = listener.last_name; var displayName = (cognome) ? nome + ' ' + cognome.charAt(0) + '.' : nome di battesimo; var photo = this.removeUrlProtocol(listener.photo || "https://wdrv.com/wp-content/plugins/hbi-player-widgets//assets/img/user.png"); var ore = Math.floor(listener.total_duration / 3600); var minutes = Math.floor(listener.total_duration / 60 % 60); // Crea elemento listener var element = document.createElement('div'); element.setAttribute('class','listener'); var imgDiv = document.createElement('div'); imgDiv.setAttribute('class', 'img'); var img = document.createElement('img'); img.setAttribute('src', foto); imgDiv.appendChild(img) elemento.appendChild(imgDiv); var content = document.createElement('div'); content.setAttribute('class', 'content'); var name = document.createElement('div'); nome.setAttribute('classe', 'nome'); nome.innerHTML = displayName; content.appendChild(nome); var info = document.createElement('div'); info.setAttribute('classe', 'info'); var hoursElement = document.createElement('span'); hoursElement.setAttribute('class', 'hours time'); oreElement.style.color = ""; hoursElement.innerHTML = ore; var minutesElement = document.createElement('span'); minutesElement.setAttribute('class', 'minuti tempo'); minutesElement.style.color = ""; minutesElement.innerHTML = minuti; var hoursLabel = document.createElement('strong'); hoursLabel.innerHTML = 'Ore'; var minutesLabel = document.createElement('strong'); minutesLabel.innerHTML = 'Minuti'; info.appendChild(hoursElement); info.appendChild(oreLabel); info.appendChild(minutesElement); info.appendChild(minutesLabel); content.appendChild(info); elemento.appendChild(contenuto); // Aggiungi elemento all'array listenerElements.push(element); io++; } // Rimuovi gli elementi correnti del listener e aggiungine di nuovi while (typeElement.hasChildNodes()) { typeElement.removeChild(typeElement.lastChild); } listenerElements.forEach(function(element) { typeElement.appendChild(element); }); } // Se i listener sono disponibili, mostra il wrapper if(d) { var listenersWrapper = this.div.getElementsByClassName('listeners-wrapper')[0]; listenersWrapper.classList.remove("nascondi"); } // Avvia il timer this.setListenerTimer(); }; // Imposta il timer per l'aggiornamento del listener this.setListenerTimer = function() { var _this = this; setTimeout(function(){ _this.ajaxLatestListeners(); }, this.listenerRefreshTime); }; this.createListenerEventListener = function() { var _this = this; this.hllforEach(this.div.querySelectorAll(".types-menu .type"), function(index, element){ element.addEventListener('click', function(event) { event.preventDefault(); _this.changeListenerTypeSection( evento.target); }); }); }; this.changeListenerTypeSection = function(element) { var listenerSection = this.div.getElementsByClassName('listeners-wrapper')[0]; var targetType = element.getAttribute('data-type-target'); var menuItem = listenerSection.querySelectorAll('[data-type-target="' + targetType + '"]')[0]; var typeSection = listenerSection.querySelectorAll('.type-section.'+targetType)[0]; if(menuItem && typeSection) { var active = listenerSection.querySelectorAll(".active"); for( var x=0; x < active.length; x++ ) { var elemento = active[x]; element.classList.remove('attivo'); } menuItem.classList.add('attivo'); typeSection.classList.add('attivo'); } }; /* * metodo forEach, potrebbe essere fornito come parte di un Object Literal/Module * - https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack/ */ this.hllforEach = function (array , callback, scope) { for (var i = 0; i < array.length; i++) { callback.call(scope, i, array[i]); // restituisce le cose di cui abbiamo bisogno } };};// Imposta e inizializza new hllNowPlayingWidgetObject('player-widget-nowplaying-6475328018248').init();

References

Top Articles
Latest Posts
Article information

Author: Trent Wehner

Last Updated: 10/19/2023

Views: 5417

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.