Skip to content

Instantly share code, notes, and snippets.

@kulte
Created March 7, 2012 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kulte/1993977 to your computer and use it in GitHub Desktop.
Save kulte/1993977 to your computer and use it in GitHub Desktop.
Spotify API
// Loading a Track
var track = Track.fromURI(uri, function(track) {
console.log(track.name + " loaded!");
if (track.playable)
// handle case in which some tracks are not playable
[...]
});
// Loading an Album
var album = Album.fromURI(uri, function(album) {
console.log(album.cover); // a URI of the album cover art
});
// This is the pattern the entire API tends to follow...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment