2012-02-13 37 views
0

所以我试图建立一个YQL表使用API​​在http://www.teamliquid.net/video/streams/?filter=live&xml=1但有一些问题。无法获得工作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> 

我实在想不通为什么它不工作。

回答

1

在调试语句中,您可以看到YQL正在从您的源URL中读取:http://www.teamliquid.net/video/streams/?xml=1&filter=live,但正在接收HTTP 406 Not Acceptable错误消息。

HTTP 406旨在涵盖服务器无法响应任何请求(Accept标头)格式的情况。我不知道如何在这种情况下适用,但teamliquid.net源提到了以下几点:

gzip encoding is required, please also send a valid User-Agent with the name of your application/site and contact info. This page and the XML are updated every five minutes, please do not poll more frequently than every five minutes or you may risk being IP banned. If you have any questions, please PM R1CH.

我怀疑这是两件事情之一:

  1. 的YQL服务器没有请求的数据采用gzip或压缩格式
  2. 的teamliquid.net服务器阻塞YQL
+0

我怀疑gzip的问题为好,谢谢! – Tony 2012-10-23 21:12:00