Skip to content

Instantly share code, notes, and snippets.

@basilhayek
Last active August 2, 2018 01:15
Show Gist options
  • Select an option

  • Save basilhayek/81cff5140ae2e40eb2c39712355cf817 to your computer and use it in GitHub Desktop.

Select an option

Save basilhayek/81cff5140ae2e40eb2c39712355cf817 to your computer and use it in GitHub Desktop.

Revisions

  1. basilhayek revised this gist Aug 2, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setlistfm_to_playlist_converter_bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    javascript:!function(){var%20t=document.title,e=%22%22,n=%22%22;if(%22www.setlist.fm%22===window.location.hostname%26%26(t.includes(%22Average%20Setlists%22)%3Fe=t.substring(0,t.indexOf(%22%20Average%20Setlists%22)):t.includes(%22Concert%20Setlist%22)%26%26(e=t.substring(0,t.indexOf(%22%20Concert%20Setlist%22))),%22%22!==e)){for(a%20of%20document.querySelectorAll(%22a.songLabel%22)){b=e;for(b2%20of%20a.parentElement.parentElement.querySelectorAll(%22div.infoPart%20%3E%20small.fontSmall%20%3E%20a%22))%22%22!==b2.textContent.trim()%26%26(b=b2.textContent);n+=b+%22%20-%20%22+a.textContent+%22\n%22}window.open(%22http://www.playlist-converter.net/%23/freetext=%22+escape(n))}}();
    javascript:!function(){var t=document.title,e="",n="";if("www.setlist.fm"===window.location.hostname&&(t.includes("Average Setlists")?e=t.substring(0,t.indexOf(" Average Setlists")):t.includes("Concert Setlist")&&(e=t.substring(0,t.indexOf(" Concert Setlist"))),""!==e)){for(a of document.querySelectorAll("a.songLabel")){b=e;for(b2 of a.parentElement.parentElement.querySelectorAll("div.infoPart > small.fontSmall > a"))""!==b2.textContent.trim()&&(b=b2.textContent);n+=b+" - "+a.textContent+"\n"}window.open("http://www.playlist-converter.net/#/freetext="+escape(n))}}();
  2. basilhayek revised this gist Aug 2, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setlistfm_to_playlist_converter_bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    javascript:!function(){var%20t=document.title,e=%22%22,n=%22%22;if(%22www.setlist.fm%22===window.location.hostname%26%26(t.includes(%22Average%20Setlists%22)%3Fe=t.substring(0,t.indexOf(%22%20Average%20Setlists%22)):t.includes(%22Concert%20Setlist%22)%26%26(e=t.substring(0,t.indexOf(%22%20Concert%20Setlist%22))),%22%22!==e)){for(a%20of%20document.querySelectorAll(%22a.songLabel%22)){b=e;for(b2%20of%20a.parentElement.parentElement.querySelectorAll(%22div.infoPart%20%3E%20small.fontSmall%20%3E%20a%22))%22%22!==b2.textContent.trim()%26%26(b=b2.textContent);n+=b+%22%20-%20%22+a.textContent+%22\n%22}window.open(%22http://www.playlist-converter.net/%23/freetext=%22+escape(n))}}();
  3. basilhayek created this gist Aug 2, 2018.
    27 changes: 27 additions & 0 deletions setlistfm_to_playlist_converter.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    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));
    }
    }