Skip to content

Instantly share code, notes, and snippets.

@uahim
Last active July 18, 2025 17:56
Show Gist options
  • Save uahim/57405f329430ce986affcd1999dc076e to your computer and use it in GitHub Desktop.
Save uahim/57405f329430ce986affcd1999dc076e to your computer and use it in GitHub Desktop.
spotify playlist to plain text list bookmarklet
// this will scrape a button attribute and convert
// More options for The Wounds We Bled by Heather Nova
// to
// Heather Nova - The Wounds We Bled
//
// works only if the spotify ui language is english
var mlnk = "";
for (var i = 0, l = document.querySelectorAll('[data-testid="more-button"]').length - 1; i < l; ++i) {
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label")) {
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").indexOf("More options for ") != -1) {
if (document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").indexOf(" by ") != -1) {
var artisttitle = document.querySelectorAll('[data-testid="more-button"]')[i].getAttribute("aria-label").replace("More options for ", "").split(" by ");
mlnk += artisttitle[1] + " - " + artisttitle[0] + "\n";
}
}
}
}
alert(mlnk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment