Skip to content

Instantly share code, notes, and snippets.

@luckycdev
Created April 28, 2022 15:26
Show Gist options
  • Save luckycdev/f3e6a9e8e54a3e304d9f9d581b2b4d1d to your computer and use it in GitHub Desktop.
Save luckycdev/f3e6a9e8e54a3e304d9f9d581b2b4d1d to your computer and use it in GitHub Desktop.
spotify search bookmarklet - spotify bookmarklet

Code:

javascript:
var a="https://open.spotify.com/search/";
var b=prompt("what song would you like to search for on Spotify?","Juice WRLD");
if(b==="")
{
alert("invalid response");
}
else if(b===" ")
{
alert("invalid response");
}
else if(b!=null)
{
open(a+encodeURI(b));
}

Bookmarklet:

javascript:var a="https://open.spotify.com/search/";var b=prompt("what song would you like to search for on Spotify?","Juice WRLD");if(b===""){alert("invalid response");}else if(b===" "){alert("invalid response");}else if(b!=null){open(a+encodeURI(b));}
javascript:var a="https://open.spotify.com/search/";var b=prompt("what song would you like to search for on Spotify?","Juice WRLD");if(b===""){alert("invalid response");}else if(b===" "){alert("invalid response");}else if(b!=null){open(a+encodeURI(b));}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment