的SoundCloud created_at [从]在一个503错误查询解析 [英] SoundCloud created_at[from] query resolving in a 503 error

查看:373
本文介绍了的SoundCloud created_at [从]在一个503错误查询解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用JavaScript SDK,我想在一个给定的流派前进(使用'created_at [从]'/曲目过滤器)来搜索所有曲目从给定日期。

我给这家JavaScript是:

  SC.get('/曲目',{流派:'金属',created_at:{来源:2014年2月26日00:00:01'}},功能(曲目){
  的console.log(曲目);
});

请求的URL作为解析:

<$p$p><$c$c>http://api.soundcloud.com/tracks?genres=metal&created_at[from]=2014-02-26%2000%3A00%3A01&client_id=MY_ID

和我得到一个503(我省略了张贴在这里我故意CLIENT_ID)

我在做什么错在这里?


解决方案

看起来像他们改变了过滤器或其或其他们正在做这个工作了一个错误:

当我打电话:

<$p$p><$c$c>http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=2010-10-10

我越来越:

 无效filter.created_at = 2010-10-10;
有效值为:last_year,last_two_weeks,LAST_WEEK,LAST_DAY,last_hour

然后,当我要求最后一个小时:

<$p$p><$c$c>http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_hour

我得到一个:503 - 服务不可用

当我将其更改为last_year,它按预期工作,
我也得到下面的XML(或JSON):

 &LT;轨道next-href=\"http://api.soundcloud.com/tracks?client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_year&genres=metal&limit=1&offset=1\"键入=阵列&GT;
&LT;轨道&GT;
&LT;&实物GT;跟踪&LT; /&实物GT;
&LT; ID类型=整数&GT; 103909859&LT; / ID&GT;
&LT;创建-AT型=日期时间&GT; 2013-08-04T01:30:44Z&LT; /创建AT&GT;
&lt;使用者-ID类型=整数&GT; 29394873&LT; /用户ID&GT;
&LT;工期类型=整数&GT; 248917&LT; /持续时间GT;
&LT; commentable类型=布尔&GT;真&LT; / commentable&GT;
&LT;州及GT;成品&LT; /州&GT;
&LT;原创内容尺寸型=整数&GT; 4696472&LT; /原始内容的大小和GT;
&LT;共享与GT;公共&LT; /共享&GT;
&LT;标签列表&gt;
exotoxis金属femalevocals岩石破碎军神低音提琴
&LT; /标签列表&gt;
&LT;&永久GT;军队的神&LT; /永久&GT;
&LT;可流类型=布尔&GT;真&LT; /流化&GT;
&LT;嵌入逐&GT;所有&LT; /嵌入逐&GT;
&LT;下载类型=布尔&GT;假LT; /下载&GT;
&LT;购-URL =零真/&GT;
&LT;标签ID无=真/&GT;
&LT;购标题零=真/&GT;
&LT;&流派GT;金属及LT; /流派&GT;
&LT;标题&GT;军神&LT; /标题&GT;
&LT;描述&GT;
欲了解更多信息的请求

编辑:
我说你是对的,SC小组应在该给出答案。

Using the JavaScript SDK, I am trying to search for all tracks in a given genre from a given date going forward (using the 'created_at[from]' /tracks filter).

My JavaScript for this is:

SC.get('/tracks', { genres: 'metal', created_at: {from: '2014-02-26 00:00:01'} }, function(tracks) {
  console.log(tracks);
});

The request URL resolves as:

http://api.soundcloud.com/tracks?genres=metal&created_at[from]=2014-02-26%2000%3A00%3A01&client_id=MY_ID

and I get a 503. (I omitted posting my client_id here intentionally)

What am I doing wrong here?

解决方案

Looks like they changed the filter or its a bug or they are working on it:

When i call:

http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=2010-10-10

I am getting:

invalid filter.created_at=2010-10-10; 
valid values are: last_year, last_two_weeks, last_week, last_day, last_hour

Then, when i call for last hour:

http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_hour

I am getting a: 503 - Service Unavailable

When i change it to last_year, it works as expected, and i get following xml (or json):

<tracks next-href="http://api.soundcloud.com/tracks?client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_year&genres=metal&limit=1&offset=1" type="array">
<track>
<kind>track</kind>
<id type="integer">103909859</id>
<created-at type="datetime">2013-08-04T01:30:44Z</created-at>
<user-id type="integer">29394873</user-id>
<duration type="integer">248917</duration>
<commentable type="boolean">true</commentable>
<state>finished</state>
<original-content-size type="integer">4696472</original-content-size>
<sharing>public</sharing>
<tag-list>
exotoxis metal femalevocals rock shredding army god double bass
</tag-list>
<permalink>army-of-god</permalink>
<streamable type="boolean">true</streamable>
<embeddable-by>all</embeddable-by>
<downloadable type="boolean">false</downloadable>
<purchase-url nil="true"/>
<label-id nil="true"/>
<purchase-title nil="true"/>
<genre>Metal</genre>
<title>Army Of God</title>
<description>
For more Information plea

EDIT: I'd say you are right and SC Team should give an answer on that.

这篇关于的SoundCloud created_at [从]在一个503错误查询解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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