Skip to content

Instantly share code, notes, and snippets.

@uahim
Created August 4, 2020 19:17
Show Gist options
  • Select an option

  • Save uahim/806044c5e03ead09c3a7c42df439f567 to your computer and use it in GitHub Desktop.

Select an option

Save uahim/806044c5e03ead09c3a7c42df439f567 to your computer and use it in GitHub Desktop.
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;
}
}
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = output;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
alert("tracklist copied");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment