Skip to content

Instantly share code, notes, and snippets.

@spiermar
Last active December 20, 2015 10:49
Show Gist options
  • Save spiermar/6118185 to your computer and use it in GitHub Desktop.
Save spiermar/6118185 to your computer and use it in GitHub Desktop.
jQuery.ajaxSetup({ cache: false });
function updatePlaylist() {
jQuery.getJSON("http://playlist-service.appspot.com/v1/playlist/last", function(data) {
var display = '';
if(data.song_artist) { display += data.song_artist + ' - '; }
display += data.song_name;
jQuery('div#playlist').text(display);
});
}
jQuery(document).ready(function () {
updatePlaylist();
setInterval(function() { updatePlaylist(); }, 30000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment