Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soundcloud/soundcloud-api-jquery-plugin
SoundCloud API jQuery plugin
https://github.com/soundcloud/soundcloud-api-jquery-plugin
Last synced: about 1 month 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 (about 14 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T17:39:59.000Z (over 9 years ago)
- Last Synced: 2024-10-07T10:58:48.178Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://soundcloud.com/developers
- Size: 218 KB
- Stars: 52
- Watchers: 185
- 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