<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
  <meta>
    <sampleQuery>select * from {table} where url="http://www.slideshare.net/cheilmann/fuel-for-a-great-web-experience"</sampleQuery>
    <author>Christian Heilmann</author>
  </meta>
  <bindings>
    <select itemPath="" produces="XML">
      <urls>
        <url>http://fake.url/{a}</url>
      </urls>
      <inputs>
        <key id='owner' type='xs:string' paramType='variable' required="true" />
      </inputs>
      <execute><![CDATA[
        var yql;
        yql = 'select owner from flickr.photos.info where photo_id in '+
        '(select id from flickr.photos.search(1) where ';
        if(owner.indexOf("@")!==-1){
          yql += 'user_id="' + owner + '"';
        } else {
          yql += 'user_id in (select value from html where '+
                 ' url="http://www.flickr.com/photos/' + owner + '" and '+
                 'xpath="//input[@name=\'w\']")';
        }
        yql += ') limit 1';
        var data = y.query(yql);  
        response.object = <item>{data.results.photo.owner}</item>;
      ]]></execute>
    </select>
  </bindings>
</table>