SoundCloud API 获取评论
我正在使用声音云API(特别是js播放器)并且想要获取特定曲目的所有评论。他们的 api 是这么说的:
/tracks/_{id}_/comments:
我不明白,ID 是什么以及一般如何查询它。你能给我一个简单的例子,如何获取该曲目的所有评论吗?
I am using sound cloud api (specifically js player) and want to get all comments of the specific track. Their api says this:
/tracks/_{id}_/comments:
which I dont get, what's ID and how to query it in general. Can you give me a simple example how to get all comments for the track?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
id 是曲目 ID,SoundCloud 上的每个曲目都有自己的 ID,您在获取曲目数据时获得它,其中一个字段称为 id。
the id is the track ID, every track on SoundCloud has its own ID you get it when you get the track data, one of the fields is called id.
要查找曲目的 ID,只需给出其永久链接(在 soundcloud.com 上查看曲目时看到的 url),然后您可以使用
/resolve
端点(换行)为了易读性)To find the ID of a track, given just its permalink (the url you see when you look at the track on soundcloud.com), then you can use the
/resolve
endpoint (broken onto a new lines for legibility)老帖子,但我最近不得不这样做。以下是如何使用 javascript 执行此操作:
要获取曲目 id,其中 PATH 是歌曲的路径:
然后使用该 ID 获取您的评论列表
Old post but I recently had to do this. Here is how to do it with javascript:
To get track id where PATH is path to song:
then use that ID to get your comment list