SoundCloud API jQuery plugin
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 3 commits ahead, 3 commits behind soundcloud:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
README
jquery.sc.api.js

README

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