https://github.com/soundcloud/soundcloud-api-jquery-plugin
SoundCloud API jQuery plugin
https://github.com/soundcloud/soundcloud-api-jquery-plugin
Last synced: 9 months ago
JSON representation
SoundCloud API jQuery plugin
- Host: GitHub
- URL: https://github.com/soundcloud/soundcloud-api-jquery-plugin
- Owner: soundcloud
- License: mit
- Created: 2010-09-04T09:59:49.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T17:39:59.000Z (about 11 years ago)
- Last Synced: 2025-01-29T21:23:50.718Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://soundcloud.com/developers
- Size: 218 KB
- Stars: 53
- Watchers: 188
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
## jQuery plugin: SoundCloud oAuth 2.0 API wrapper
### A simple usage example
First and most important, you'll need to get a Client ID from SoundCloud. If
you haven't got one already, just register an app on the SoundCloud [Apps][] page.
[apps]: http://soundcloud.com/you/apps/new
Include the plugin in your HTML code:
```html
```
and then, initialize it:
```javascript
var api = $.sc.api('Enter your Client ID here');
```
or handle the successful authorization yourself:
```javascript
var api = $.sc.api('Enter your Client ID here', {
onAuthSuccess: function(user, container) {
alert('you are SoundCloud user ' + user.username);
}
});
```
also instead of passing the callbacks you can use the custom events:
```javascript
var api = $.sc.api('Enter your Client ID here');
$(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][] for full documentation.
[wiki]: https://github.com/soundcloud/SoundCloud-API-jQuery-plugin/wiki