如何通过标签与声音云API搜索特定用户的轨道? [英] How to search specific user's tracks by tag with the Sound Cloud API?

查看:174
本文介绍了如何通过标签与声音云API搜索特定用户的轨道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要搜索按标签只与我的用户名,即英国皇家歌剧院的轨道。

例如:

<$p$p><$c$c>http://api.soundcloud.com/users/royaloperahouse/tracks/?client_id=238947HSGDHSDG&tags=eric

告诉我,我需要使用q参数。幽默是我搜索:

<$p$p><$c$c>http://api.soundcloud.com/users/royaloperahouse/tracks/??client_id=238947HSGDHSDG&tags=eric&q=e

和简单地从整个声音云不涉及只是我的用户的那些的获取声音的列表。
同样,如果我尝试搜索曲目API(而不是用户),并限制与&放查询; USER_ID 我得到与所有用户而不是一个具体的皇家歌剧院视频

的最终目标是要找到所有曲目的​​皇家歌剧院上传与特定的艺术家。目前,我们正在解决的方式是让我们所有的载轨道(37为present),并通过这些迭代由相关标签相匹配的轨道。显然我们音乐列表的增长,这将开始是一个问题。

感谢。


解决方案

我以前没有使用过这个API,但经过几次测试,我想我已经找到了你的问题。

您不应该使用用户作为第一个URL部分,因为你不是搜索用户,您正在搜索通过用户名和标签过滤轨道。

而不是使用歌曲作为第一个URL段,并使用问:参数来筛选的用户名。然后你可以使用使用代码参数为好。

测试此链接: http://api.soundcloud.com/tracks? q =用户名和放大器;标签=标记

  SC.get('/音轨/',{Q:royaloperahouse',标签:'洞察力'},功能(结果){
    的console.log(结果[0] .tag_list);
});

说实话我还是不明白的问:参数。在API文档,你发现的曲目,用户等,并在搜索页面,他们谈论它过于它的引用,但我还没有发现什么的问:参数在每个查询过滤类型的任何文档。在曲目是用户名(以及可能的用户ID)

如果你是消费这个API,你应该问的SoundCloud队在他们的谷歌组此参数的更多的含义。

I want to search for tracks by tag relating only to my user name i.e. the Royal Opera House.

For example:

http://api.soundcloud.com/users/royaloperahouse/tracks/?client_id=238947HSGDHSDG&tags=eric

tells me I need to use a q parameter. To humour it I search:

http://api.soundcloud.com/users/royaloperahouse/tracks/??client_id=238947HSGDHSDG&tags=eric&q=e

and simply get a list of sounds from the whole of Sound Cloud not the ones relating to just my user. Similarly if I try and search the tracks API (not by users) and limit the query with &user_id I get videos relating to all users not one specific to the Royal Opera House.

The ultimate aim is to find all tracks that the Royal Opera House has uploaded relating to a specific artist. At the moment the way we are solving it is by getting all of our uploaded tracks (37 at present) and iterating through those to match the tracks by the relevant tag. Obviously as our music list grows this will start to be a problem.

Thanks.

解决方案

I haven't used this API before, but after a few tests i think i've found your problem.

You shouldn't use users as the first url segment because you aren't searching for users, you are searching for tracks filtered by username and tags.

Instead use tracks as the first url segment, and use the q parameter to filter the username. Then you can use use the tags parameter as well.

Test this url: http://api.soundcloud.com/tracks?q=username&tags=tag

SC.get('/tracks/', {q:'royaloperahouse', tags: 'insights' },  function(result) { 
    console.log(result[0].tag_list);
});

To be honest i still do not understand the q parameter. In API documentation you find references about it in tracks, users, etc and in search page they talk about it too but i haven't found any documentation about what the q parameter is filtering in each query type. In tracks is the username (and possible user id)

If you are consuming this API, you should ask soundcloud team in their google group more the meaning of this parameter.

这篇关于如何通过标签与声音云API搜索特定用户的轨道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆