Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Firstly, you should be looking at the <a href="http://developer.yahoo.com/yql/guide/yql-opentables-reference.html#yql-opentables-paging" rel="nofollow noreferrer">paging model</a> (Your link got compressed above, so I'm just putting it here.</p> <p>When you use the paging with no <code>&lt;execute&gt;&lt;/execute&gt;</code> block specified, it will be used in the query string with the URL specified in <code>&lt;url&gt;&lt;/url&gt;</code>. Just play with the <a href="http://developer.yahoo.com/yql/guide/yql-opentables-sample.html#yql-opentables-sample-flickr-photo-search" rel="nofollow noreferrer">Flickr Photo Search Example</a>, you have to run it in the Console with Diagnostics turned on to look at the changes in the URL. The <code>id</code> attribute is used to insert the number in the query. Just to illustrate here, the paging portion looks like this:</p> <pre><code> &lt;paging model="page"&gt; &lt;start id="page" default="0" /&gt; &lt;pagesize id="per_page" max="250" /&gt; &lt;total default="10" /&gt; &lt;/paging&gt; </code></pre> <p>For example, querying</p> <pre><code>select * from flickr.photos.search(10,20) where has_geo="true"` </code></pre> <p>The URL used was <code>http://api.flickr.com/services/rest/?method=flickr.photos.search&amp;has_geo=true&amp;page=1&amp;per_page=30</code>. As you can see, it actually took the <code>page=1</code> but asked for <code>per_page=30</code> and internally truncated the first 10 results so that you get an offset of 10 and a total of 20 results. The reason why YQL did this is because the model selected is <code>page</code>.</p> <p>Another example, if you attempt to do this: </p> <pre><code>select * from flickr.photos.search(249,2) where has_geo="true" </code></pre> <p>YQL will retrieve both <code>...&amp;page=1&amp;per_page=250</code> and <code>...&amp;page=2&amp;per_page=250</code> <sub>(I've shortened the urls for illustration)</sub> as expected to get the results.</p> <p>The paging variables are also defined in the global scope if you use JavaScript in <code>&lt;execute&gt;&lt;/execute&gt;</code> section. You can see this being used in the <a href="http://github.com/yql/yql-tables/blob/master/flickr/flickr.photos.astro.xml" rel="nofollow noreferrer">flickr.photos.astro OpenData Table</a>.</p> <p>I guess that should answer the question for you, since I see that <a href="http://github.com/yql/yql-tables/blob/master/mozillalabs/jetpackgallery/mozillalabs.jetpackgallery.tag.info.xml" rel="nofollow noreferrer">on GitHub</a>, you have been working on how to extract the pages using XPath.</p> <p>For your case you should have something like:</p> <pre><code> &lt;paging model="page"&gt; &lt;start id="page" default="1" /&gt; &lt;pagesize id="per_page" max="10" /&gt; &lt;total default="10" /&gt; &lt;/paging&gt; </code></pre> <p>The <code>per_page</code> would be in your internal query but it's used for the YQL to determine the queries needed. Then in your JavaScript could probably do something like:</p> <pre><code> y.query( "select * from html where url=@url", {url: "http://jetpackgallery.mozillalabs.com/jetpacks?page=" + page} ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload