Created
June 10, 2016 20:55
-
-
Save typeetfunc/e3e251c468f5f2b7dbfeb43f7f36e3fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ids = ['26052399', '26035461', '26035459', '26035454', '26035467'] | |
var links = Array.prototype.slice.call(document.getElementsByClassName('song_button'), 0).filter(a => ids.find(id => id === a.dataset.playSong)) | |
var current = 0; | |
setInterval( | |
() => { | |
var hasPlaying = links.map(a => a.classList.contains('playing')).filter(a => a).length; | |
if (hasPlaying) { | |
console.log('skip') | |
return; | |
} else { | |
console.log('next') | |
current = current > links.length - 1 ? 0 : current; | |
links[current].click(); | |
current++; | |
return; | |
} | |
}, | |
1000 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment