Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (21 sloc) 0.875 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
  <meta>
    <sampleQuery>select * from {table} where username="codepo8"</sampleQuery>
    <author>Christian Heilmann</author>
    <description>Gets the Flickr User ID from a user name</description>
  </meta>
  <bindings>
    <select itemPath="" produces="XML">
      <inputs>
        <key id='username' type='xs:string' paramType='variable' required="true" />
      </inputs>
      <execute><![CDATA[
var x = y.query('select href from html where url="http://www.flickr.com/photos/'+username+'" and xpath="//link[contains(@href,\'photos_public\')]" limit 1');
var h = y.xpath(x.results,'//@href');
var id = h.split('id=')[1].split('&')[0];
response.object = <user_id>{id}</user_id>;
]]></execute>
    </select>
  </bindings>
</table>
Something went wrong with that request. Please try again.