Created
January 28, 2016 07:58
-
-
Save cybrox/77b6a259bf965ad5a19c to your computer and use it in GitHub Desktop.
Extract song titles from the google music mini player
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
var songString = ""; | |
var songEntries = document.getElementsByClassName('song-row'); | |
for (var i = 0; i < songEntries.length; i++) { | |
var song = songEntries[i]; | |
for (var j = 0; j < song.childNodes.length; j++) { | |
if (song.childNodes[j].getAttribute('data-col') == 'song-details') { | |
var col = song.childNodes[j].childNodes[2].childNodes[1]; | |
songString += col.childNodes[1].childNodes[0].innerText + ' - '; | |
songString += col.childNodes[0].innerText + '\n'; | |
} | |
} | |
} | |
console.log(songString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment