编程语言
首页 > 编程语言> > javascript – 获取用户的最新SoundCloud Track链接

javascript – 获取用户的最新SoundCloud Track链接

作者:互联网

我一直在寻找一种方法来做这件事,因为看起来他们应该是一个.

我只是想从SoundCloud页面自动拉出5个最近的曲目,并将它们放在我的网站上的“最新音频”部分下.

SoundCloud甚至自己做到了这一点.如果你去特定的曲目,在页面的右下角有一个’USERNAME的更多曲目’,看看:
http://soundcloud.com/goldenstatewarriors/mark-jackson-on-the-dan

我发现的最接近的是:

http://api.soundcloud.com/tracks?client_id={client_id}

但为此你需要一个client_id,用于soundcloud应用程序.我尝试注册一个应用程序,但当我输入给我的client_id到上面时,我得到了一堆不属于我的轨道:

http://api.soundcloud.com/tracks?client_id=02db8e29aa2fb5bf590f478b73137c67

我只知道必须有办法做到这一点……

解决方法:

答案很简单

http://api.soundcloud.com/users/<USER_ID>/tracks.json?client_id=APP_ID

像这样打它:

http://api.soundcloud.com/users/jakuboboza/tracks.json?client_id=APP_ID 

你得到:

[{"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"...

按created_at和profit :)排序

干杯!希望这可以帮助

标签:soundcloud,html,javascript
来源: https://codeday.me/bug/20190729/1573347.html