因此,我正在尝试使用http://www.teamliquid.net/video/streams/?filter=live&xml=1上的API设置一个YQL表,但遇到了一些问题。
下面是我的表定义:
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>TL.net</author>
<description>TL.net's streams</description>
<documentationURL>none</documentationURL>
<sampleQuery>select * from {table}</sampleQuery>
</meta>
<bindings>
<select itemPath="streamlist" produces="XML">
<urls>
<url>http://www.teamliquid.net/video/streams/?xml=1</url>
</urls>
<inputs>
<key id="filter" type="xs:string" paramType="query" />
</inputs>
</select>
</bindings>
</table>运行use "store://q5awkFLmEqteFVOTUJbQ6h" as tl; select * from tl where filter="live"会产生以下错误:
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="0" yahoo:created="2012-02-13T22:14:48Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-start-time="1" execution-stop-time="33"
execution-time="32" proxy="DEFAULT"><![CDATA[store://q5awkFLmEqteFVOTUJbQ6h]]></url>
<url execution-start-time="35" execution-stop-time="232"
execution-time="197" http-status-code="406"
http-status-message="Not Acceptable" proxy="DEFAULT"><![CDATA[http://www.teamliquid.net/video/streams/?xml=1&filter=live]]></url>
<user-time>232</user-time>
<service-time>258</service-time>
<build-version>25247</build-version>
</diagnostics>
<results/>
</query>我真的不明白为什么它不能工作。
发布于 2012-10-21 09:43:34
在调试语句中,您可以看到YQL正在读取源URL:http://www.teamliquid.net/video/streams/?xml=1&filter=live,但是收到了HTTP406不可接受的错误消息。
HTTP 406旨在覆盖服务器不能以任何请求的(接受报头)格式响应的情况。我不知道这在这种情况下是如何应用的,但teamliquid.net源代码提到了以下内容:
需要
gzip编码,请同时发送有效的用户代理和您的应用程序/站点的名称和联系信息。此页面和XML每五分钟更新一次,请不要每隔五分钟轮询一次,否则您可能会面临被IP禁止的风险。如果您有任何问题,请PM R1CH。
我怀疑这是两件事中的一件:
https://stackoverflow.com/questions/9268864
复制相似问题