Skip to content

Instantly share code, notes, and snippets.

@titangene
Last active April 9, 2021 12:34
Show Gist options
  • Save titangene/c59a70f64dda51732bb50096f79bb10d to your computer and use it in GitHub Desktop.
Save titangene/c59a70f64dda51732bb50096f79bb10d to your computer and use it in GitHub Desktop.
Copy the name of the music that Spoifty is playing
(function() {
let title = document.querySelector('[data-testid=nowplaying-track-link]').textContent;
let singers = document.querySelector('[data-testid="track-info-artists"]').querySelectorAll('a');
let singerList = [...singers].map(x => x.textContent).join(' & ');
let textArea = document.createElement('textarea');
textArea.value = `${singerList} - ${title}`;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('Copy');
textArea.remove();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment