Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding tables from salathe

  • Loading branch information...
commit 2fb45afc4c2be83da04f3dc345bd93b9c880c7cf 2 parents f2e4baa + 7f3465e
@sh1mmer sh1mmer authored
Showing with 53 additions and 0 deletions.
  1. +20 −0 flickr/flickr.photosets.getList.xml
  2. +33 −0 tmdb/jp.xml
View
20 flickr/flickr.photosets.getList.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
+ <meta>
+ <sampleQuery>select * from {table} where user_id="11414938@N00"</sampleQuery>
+ <description>Retrieve the photosets belonging to the specified user.</description>
+ <documentationURL>http://www.flickr.com/services/api/flickr.photosets.getList.html</documentationURL>
+ <author>Peter Cowburn</author>
+ </meta>
+ <bindings>
+ <select itemPath="rsp.photosets.photoset" produces="XML">
+ <urls>
+ <url env="all">http://api.flickr.com/services/rest/?method=flickr.photosets.getList</url>
+ </urls>
+ <inputs>
+ <key id="user_id" type="xs:string" paramType="query" />
+ <key id="api_key" type="xs:string" const="true" private="true" paramType="query" default="9aae7ac1770fdd8027b7aec220ae6400"/>
+ </inputs>
+ </select>
+ </bindings>
+</table>
View
33 tmdb/jp.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
+ <meta>
+ <sampleQuery>select * from {table} where movieid="27205"</sampleQuery>
+ <description>Retrieve movie title and year from TMDB. See http://stackoverflow.com/questions/3292899/tailoring-the-output-of-yql</description>
+ <author>Peter Cowburn</author>
+ </meta>
+ <bindings>
+ <select itemPath="movie" produces="XML">
+ <inputs>
+ <key id="movieid" type="xs:string" paramType="variable" required="true"/>
+ </inputs>
+ <execute><![CDATA[
+var query = 'select content from html where url="http://www.themoviedb.org/movie/'
+ + movieid + '" and xpath=\\'//h3[@id="year"]|//h2[@id="title"]/a\\'';
+
+var result = y.query(query).results;
+var movie = <movie/>;
+
+// The title can span multiple lines, lets remove breaks.
+var title = result.a.text().toString().replace(/\\s+/g, ' ');
+
+// The year has parentheses around it, let's remove those.
+var year = result.h3.text().toString().replace(/^\\(|\\)$/g, '');
+
+movie.node += <title>{title}</title>;
+movie.node += <year>{year}</year>;
+
+response.object = movie;
+]]></execute>
+ </select>
+ </bindings>
+</table>
Please sign in to comment.
Something went wrong with that request. Please try again.