Skip to content

Instantly share code, notes, and snippets.

@nwillems
Last active December 22, 2015 23:39
Show Gist options
  • Save nwillems/6548211 to your computer and use it in GitHub Desktop.
Save nwillems/6548211 to your computer and use it in GitHub Desktop.
Little script to provide link for the currently playing song on Berri radio(http://m.fatberris.com/)

When on http://m.fatberris.com press the F12-button and go to the console-tab. Copy and paste the below script into the console and press enter, skip a song, and the link appears together with remaining time.

// Run me from your developer console and get a link to that sweet tune playing in your ears!
// Developer console accesible from either "file"-menu or F12
var additionalInfo = $('<div>');
additionalInfo.attr('id', "TuneLink");
var timeInfo = $('<div>');
timeInfo.attr('id', "Time");
$('div[role=main]').append(additionalInfo, timeInfo);
$('#player').bind(
$.jPlayer.event.playing,
function(){
$('#TuneLink').html(
$('<a>').attr('href', $('#player audio').attr('src')).text("Dat tune")
);
}
);
$('#player').bind(
$.jPlayer.event.timeupdate,
function(event){
var status = event.jPlayer.status;
var remaining = Math.floor(status.duration - status.currentTime );
$('#Time').html('Remaining time: ' + $.jPlayer.convertTime(remaining));
}
);
//Allow right click
$(document).unbind("contextmenu")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment