问题
I've been looking for a way to do this for a while because it seems like their should be one.
I just want to automatically pull the 5 most recent tracks from my SoundCloud page and put them on my website under a 'Newest Audio' section.
SoundCloud even does this themselves. If you go to a specific track, on the right bottom of the page it has a 'More tracks by USERNAME,' take a look: http://soundcloud.com/goldenstatewarriors/mark-jackson-on-the-dan
The closest thing I have found is this:
http://api.soundcloud.com/tracks?client_id={client_id}
But for that you need a client_id, which is for soundcloud apps. I tried registering an app, but when I input the client_id
given to me into the above, I get a bunch of tracks that aren't mine:
http://api.soundcloud.com/tracks?client_id=02db8e29aa2fb5bf590f478b73137c67
I just know there has to be a way to do this...
回答1:
The answer is simple
http://api.soundcloud.com/users/<USER_ID>/tracks.json?client_id=APP_ID
hitting it like this:
http://api.soundcloud.com/users/jakuboboza/tracks.json?client_id=APP_ID
you get:
[{"kind":"track","id":3481075,"created_at":"2010/06/16 12:27:20 +0000","user_id":1187050,"duration":1331,"commentable":true,"state":"finished","original_content_size":15835,"sharing":"public","tag_list":"","permalink":"nl-lul","description":"","streamable":true,"downloadable":false,"genre":"","release":"","purchase_url":null,"purchase_title":null,"label_id":null,"label_name":"","isrc":"","video_url":null,"track_type":"","key_signature"...
sort it by created_at
and profit :)
Cheers! Hope this helps
来源:https://stackoverflow.com/questions/10454218/get-a-users-most-recent-soundcloud-track-links