var t = document.title; var b0 = ""; var s = ""; if (window.location.hostname === "www.setlist.fm") { if (t.includes("Average Setlists")) { b0 = t.substring(0, t.indexOf(" Average Setlists")); } else if (t.includes("Concert Setlist")) { b0 = t.substring(0, t.indexOf(" Concert Setlist")); } // Make sure we're on a supported page by checking if we have the band name if (b0 !== "") { // Iterate through all the songs for (a of document.querySelectorAll("a.songLabel")) { b = b0; // Sometimes songs in the setlist might be from another artist; so use those instead for (b2 of a.parentElement.parentElement.querySelectorAll("div.infoPart > small.fontSmall > a")) { if (b2.textContent.trim() !== "") { b = b2.textContent; } } // Build the entry for the song s += b + " - " + a.textContent + "\n"; } // Jump over to playlist-converter.net window.open("http://www.playlist-converter.net/#/freetext=" + escape(s)); } }