Skip to content

Instantly share code, notes, and snippets.

@jprudent
Last active Feb 21, 2022
Embed
What would you like to do?
Play random album on deezer
/*
This is semi-automated (read quick & dirty, didn't polished) way to play a random album on Deezer
You need to navigate to the fav albums page, press F12 and past this gist in the console.
*/
(async function() {
for(let i = 0; i< 500; i++) {
window.scrollTo(0, document.body.scrollHeight);
await new Promise(r => setTimeout(r, 2));
}
var playBtn = document.querySelectorAll('button.action-item-btn[aria-label=\'Pause\']');
playBtn[Math.floor(Math.random() * playBtn.length)].click();
console.log(`${playBtn.length} albums`);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment