Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (31 sloc) 1.166 kb
a661318 Re-adding powerhousemuseum (again)
Allan Shone authored
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
3 <meta>
4 <author>Allan Shone</author>
5 <documentationURL>http://api.powerhousemuseum.com/</documentationURL>
6 <description>Query the Powerhouse Museum for multimedia items.</description>
1d0aa7c @CerealBoy Updating all sample queries to use the {table} syntax
CerealBoy authored
7 <sampleQuery>select * from {table} where caption='bucket' and api_key='...'</sampleQuery>
a661318 Re-adding powerhousemuseum (again)
Allan Shone authored
8 </meta>
9
10 <bindings>
11 <select itemPath="" produces="JSON">
12 <urls>
13 <url></url>
14 </urls>
15 <inputs>
16 <key id='caption' type='xs:string' paramType='path' required='true' />
17 <key id='api_key' type='xs:string' paramType='path' required='true' />
18 </inputs>
19
20 <execute><![CDATA[
21
22 var query = '';
23 var base_url = 'http://api.powerhousemuseum.com/api/v1/multimedia/';
24
25 if (parseInt(caption).toString() == "NaN") {
26 base_url += 'xml/?api_key=' + api_key + '&caption=' + caption;
27 } else {
28 base_url += parseInt(caption) + '/xml/?api_key=' + api_key;
29 }
30
31 query = y.query('select * from xml where url="' + base_url + '"');
32
33 response.object = query.results;
34
35 ]]></execute>
36 </select>
37 </bindings>
38 </table>
Something went wrong with that request. Please try again.