Skip to content

Instantly share code, notes, and snippets.

@uahim
Last active August 5, 2020 22:22
Show Gist options
  • Save uahim/f17ad6da1182958a0d3eae781aef4bf6 to your computer and use it in GitHub Desktop.
Save uahim/f17ad6da1182958a0d3eae781aef4bf6 to your computer and use it in GitHub Desktop.
throws a properly structured tracklist on embedded playlists
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