Last active
August 5, 2020 22:22
-
-
Save uahim/f17ad6da1182958a0d3eae781aef4bf6 to your computer and use it in GitHub Desktop.
throws a properly structured tracklist on embedded 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
javascript: | |
var i,j=0,output=""; | |
for (var i = 0, l = document.getElementsByTagName("span").length - 1; i < l; ++i) { | |
if (i == 0 || i == 1) { | |
continue; | |
} | |
if (i % 2 == 0) { | |
j++; | |
if (j < 10) { | |
var k = j.toString(); | |
k = "0" + k; | |
} else { | |
k = j; | |
} | |
output += k + ". " + document.getElementsByTagName("span")[i + 1].innerText + " - " + document.getElementsByTagName("span")[i].innerText + "\n"; | |
} else { | |
continue; | |
} | |
} | |
alert(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment