Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Created August 22, 2014 04:16
Show Gist options
  • Select an option

  • Save JRJurman/347796794fc490c7583e to your computer and use it in GitHub Desktop.

Select an option

Save JRJurman/347796794fc490c7583e to your computer and use it in GitHub Desktop.
var urlList = [
"http://www.audiosparx.com/sa/archive/Keyboard/Piano-electric/Ambush-Piano-Loop/534060",
"http://www.audiosparx.com/sa/archive/Jazz/Jazz-Funk/Ambush-Short/534117"
];
function playSong() {
url = urlList.pop()
var aWin = open(url);
var time = ""
var total_time = 0
function closeAWin() {
aWin.close()
}
function getTime() {
time = $(aWin.$("span.pfont8").get(1)).text().split(":")
total_time = time[0]*60;
total_time += time[1]*1;
total_time = total_time*1000;
total_time -= 3000;
setTimeout( closeAWin, total_time );
setTimeout( playSong, total_time );
}
setTimeout( getTime, 3000 );
}
urlList.reverse()
playSong()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment