Last active
September 2, 2018 12:04
-
-
Save clempat/4a30a73df10185b9bd179d0c0438881e to your computer and use it in GitHub Desktop.
Extract musiques from Napster playlists
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 getMusics () { | |
let musicDomColletion = document.getElementsByClassName("name-and-title"); | |
let musics = []; | |
return Array.from(musicDomColletion).map(musicDOM => ({ | |
title: musicDOM.getElementsByClassName('name')[0].innerText.replace(/(\r\n\t|\n|\r\t)/gm,""), | |
artiste: musicDOM.getElementsByClassName('artist-name')[0].innerText.replace(/(\r\n\t|\n|\r\t)/gm,"") | |
})) | |
} | |
getMusics().map(musique => musique.title + ' - ' + musique.artiste).join('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment