Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
jQuery plugin: SoundCloud oAuth2 API wrapper
A simple usage example:
include the plugin in your HTML code
<script type="text/javascript" charset="utf-8" src="scripts/jquery.sc.api.js"></script>
an then, initialize it
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg');
or handle the successful authorization yourself
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg', {
onAuthSuccess: function(user, container) {
alert('you are SoundCloud user ' + user.username);
}
});
also instead of passing the callbacks you can use the custom events
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg');
$(document).bind($.sc.api.events.AuthSuccess, function(event) {
var user = event.user;
// do something with the user object or call the api
api.get('/me/tracks', function(tracks) {
console.log(tracks);
})
});
Please refer to the wiki on GitHub project page for full documentation