Skip to content

Instantly share code, notes, and snippets.

@harv
Created May 5, 2013 06:36
Show Gist options
  • Save harv/5519946 to your computer and use it in GitHub Desktop.
Save harv/5519946 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Harv.c</author>
<sampleQuery>select * from {table} where url="http://www.tudou.com/v/CTBL4A12JGc/v.swf" and referer="http://e.weibo.com/tudoupebble"</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="json">
<inputs>
<key id="url" type="xs:string" paramType="variable" required="true" />
<key id="referer" type="xs:string" paramType="variable" required="false" />
</inputs>
<execute><![CDATA[
var req = y.rest(url);
if(referer) req.header("Referer", referer);
response.object = req.followRedirects(false).get().headers.location;
]]>
</execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment