Created
January 31, 2014 21:00
-
-
Save thelinmichael/8743028 to your computer and use it in GitHub Desktop.
Spotify Apps API - Get a list of artists and users that a specified user is following
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
<html> | |
<head> | |
</head> | |
<body> | |
<script> | |
require(["$api/models#User", "$api/relations#Relations"], function(User, Relations) { | |
var username = "kristiankarl"; | |
var relations = Relations.forUser(User.fromURI("spotify:user:" + username)); | |
relations.load("combinedSubscriptions").done(function() { | |
relations.combinedSubscriptions.snapshot().done(function(snapshot) { | |
console.log("Following: " + snapshot.length); | |
}); | |
}).fail(function() { | |
console.log("Failed to get user relations"); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment