Last active
April 9, 2021 12:34
-
-
Save titangene/c59a70f64dda51732bb50096f79bb10d to your computer and use it in GitHub Desktop.
Copy the name of the music that Spoifty is playing
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
(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