Skip to content

Instantly share code, notes, and snippets.

@wittemann
Created January 15, 2010 11:41
Show Gist options
  • Save wittemann/277984 to your computer and use it in GitHub Desktop.
Save wittemann/277984 to your computer and use it in GitHub Desktop.
gitbug.gist.list.xml
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Martin Wittemann</author>
<documentationURL></documentationURL>
<sampleQuery>select * from {table} where user='wittemann'</sampleQuery>
</meta>
<bindings>
<select itemPath="gists" produces="XML">
<urls>
<url>http://gist.github.com/api/v1/xml/gists/{user}</url>
</urls>
<inputs>
<key id="user" type="xs:string" paramType="path" required="true"/>
</inputs>
<execute><![CDATA[
var list = request.get().response;
for (var i = 0; i < list.gist.length(); i++) {
var repo = list.gist[i].repo;
var q = y.query('use "http://github.com/wittemann/yql-tables/raw/master/github/github.gist.content.xml" as ghc; select * from ghc where repo=' + repo);
var content = q.results.content + "";
list.gist[i].node += content
}
response.object = list;
]]></execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment