2013-03-14 69 views
0

有关在Soundcloud中使用API​​的另一个问题(我正在使用PHP)。Soundcloud中的日期 - API

我会上传大量声音,其中一些声音记录在1994年左右。我希望能够使用搜索API来检索具有此日期的文件。

我可以看到轨道资源包含[release_day],[release_month]和[release_year] - 但这些字段在查询中似乎不可用作过滤器,是正确的吗?

所以,如果我不能使用这些字段的日期搜索,我能想到的唯一的其他选择是使用[created_at]字段,因为这可以在搜索中使用。

只是 - 我已经试过,但我似乎不能够修改那件使用API​​数据。我成功地修改元数据的其他部分,但是,例如(使用PHP代码段):

$client->put('tracks/' . $track->id, array(
     'track[created_at]' => "1994/03/14 07:35:57 +0000", 
     'track[description]' => 'This track was recorded in Berlin' 

)); 

,没有任何效果,这我相信意味着我不能做什么,我需要做什么?

我该如何解决这个问题,并允许我网站上的用户搜索1994年或类似录制的声音文件?

非常感谢。

回答

0

首先,查询跟踪,每个文件,方法是:

created_at[from] date (yyyy-mm-dd hh:mm:ss) return tracks created at this date or later 
created_at[to] date (yyyy-mm-dd hh:mm:ss) return tracks created at this date or earlier 

目前没有工作,与许多其他查询上的SoundCloud的。

除了它作为查询被破坏之外,created_at时间戳是在轨道上传时添加的,并且是不可修改的。通过释放相关的参数来搜索的唯一方法是通过诸如其子资源的一个第一搜索:

GET  /users/{id}/tracks list of tracks of the user 
GET  /users/{id}/playlists list of playlists (sets) of the user 
GET  /tracks/{id}/comments comments for the track 
GET  /tracks/{id}/comments/{comment-id} a comment for the track 
GET  /tracks/{id}/favoriters  users who favorited the track 
GET  /tracks/{id}/favoriters/{user-id} a user who has favorited to the track 
GET  /tracks/{id}/shared-to/users users who have access to the track 
GET  /tracks/{id}/shared-to/emails email addresses who are invited to the track 

,然后过滤基于轨道的释放性的结果。因此,例如,您可以通过/ users/{id} /播放列表进行搜索,然后按发布日期对该播放列表中曲目的结果进行过滤。

+0

嘿,你能告诉我你的确切要求不适合你吗?当你说“不行”时,你的意思是?你得到5xx错误还是4xx?谢谢! – 2013-03-15 10:33:27