Reputation: 328
I'm using the JavaScript SDK for the Soundcloud API and trying to populate the top 10 tracks from authenticated users stream.
Currently I am implementing this with:
SC.get('/tracks', { limit: '10'}, function(tracks) {
//Do stuff with tracks
});
However, this only returns the most recent 10 tracks/sounds uploaded to SoundCloud. Is there an easy way to populate my stream?
Upvotes: 0
Views: 637
Reputation: 2702
I was looking for the same thing, but there is no way to get the complete user's stream. You can get the users activities from
https://api.soundcloud.com/me/activities.json
But there are not all songs listed from your stream. I hope the SoundCloud devs will make that thing better in the future.
Upvotes: 1
Reputation: 1
Try to use this code
fetch: function () {
var self = this;
SC.get("/tracks", { limit: '10'}, function (data) {
self.tracks = $.map(data, function (track) {
return {
title: track.title
};
});
self.attachTemplate();
});
}
soundcloud.init({
template: $('#tracks-template').html(),
container: $('ul.soundcloud')
});
And show the item title in your HTML page.
Upvotes: 0