Created
June 24, 2018 22:08
-
-
Save Mathspy/e56ae92cfbf153fbadc95621ff03fe71 to your computer and use it in GitHub Desktop.
Turns a Spotify playlist into an array for copying
This file contains hidden or 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
Array.from(document.querySelectorAll(".track-name-wrapper")).map(node => { | |
let temp = {} | |
temp.name = node.firstElementChild.textContent | |
let artistAlbum = node.lastElementChild.querySelectorAll("a") | |
temp.artist = {name: artistAlbum[0].textContent, link: artistAlbum[0].href} | |
temp.album = {name: artistAlbum[1].textContent, link: artistAlbum[1].href} | |
return temp | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment