Created
June 13, 2012 15:04
-
-
Save nhitze/2924633 to your computer and use it in GitHub Desktop.
YQL Thingieverse Table for Categories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Nils Hitze</author> | |
<documentationURL>http://silberkind.de/+</documentationURL> | |
<sampleQuery>select * from {table} where category='toys-and-games'</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="" produces="XML"> | |
<urls> | |
<url>http://www.thingiverse.com/categories/{category}</url> | |
</urls> | |
<inputs> | |
<key id="category" type="xs:string" required="true" paramType="path" /> | |
</inputs> | |
<execute> | |
<![CDATA[ | |
var query = null; | |
var xpath = "//div[@class='things']/*"; | |
query = y.query("select * from html where url=@url and xpath=\""+xpath+"\"", {url:request.url}); | |
var results = query.results.results; | |
for (var i = 0; i < results.length; ++i) { | |
y.log(results[i]); | |
} | |
var json = {}; | |
response.object = results.results; | |
]]> | |
</execute> | |
</select> | |
</bindings> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment