2012-02-13 39 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