Skip to content

Instantly share code, notes, and snippets.

@jprudent
Last active February 21, 2022 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jprudent/78c22ba84815a3c35874bbbca73afbe3 to your computer and use it in GitHub Desktop.
Save jprudent/78c22ba84815a3c35874bbbca73afbe3 to your computer and use it in GitHub Desktop.
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