首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >让YQL表正常工作时遇到问题

让YQL表正常工作时遇到问题
EN

Stack Overflow用户
提问于 2012-02-14 06:15:57
回答 1查看 219关注 0票数 0

因此,我正在尝试使用http://www.teamliquid.net/video/streams/?filter=live&xml=1上的API设置一个YQL表,但遇到了一些问题。

下面是我的表定义:

代码语言:javascript
复制
<?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"会产生以下错误:

代码语言:javascript
复制
<?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>

我真的不明白为什么它不能工作。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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。

我怀疑这是两件事中的一件:

  1. YQL服务器未请求gzip或压缩格式的数据
  2. teamliquid.net服务器正在阻止YQL
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9268864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档