Last active
August 29, 2015 14:24
-
-
Save basketofsoftkittens/7a3ee1405ca542743a02 to your computer and use it in GitHub Desktop.
get track id from tack click find music bookmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:$(function(){function a(a){alert(a)}$(document).on("click",".track-list li",function(t){var r=$(t.currentTarget),e=r.attr("data-id"),c=getParameterByName("locale")||getParameterByName("locale","hash",!0),n=$("#search_input").val();return n?void $.ajax({url:"/api/music/search/",data:{terms:n,countryCode:c?getCountry(c):"us"},dataType:"json",success:function(t){if(t&&t.data){var r=!1;t.data.forEach(function(t){t.trackId==e&&(r=!0,a("TRACK LABEL FOUND: "+t.trackLabel))}),r||a("no track found with that track id")}}}):a("no search terms found in the search box")})}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment