Note that there are some explanatory texts on larger screens.

plurals
  1. POYoutube API - How to limit results for pagination?
    primarykey
    data
    text
    <p>I want to grab a user's uploads (ie: BBC) and limit the output to 10 per page.</p> <p>Whilst I can use the following URL: <a href="http://gdata.youtube.com/feeds/api/users/bbc/uploads/?start-index=1&amp;max-results=10" rel="noreferrer">http://gdata.youtube.com/feeds/api/users/bbc/uploads/?start-index=1&amp;max-results=10</a></p> <p>The above works okay.</p> <p>I want to use the query method instead:</p> <p>The Zend Framework docs: <a href="http://framework.zend.com/manual/en/zend.gdata.youtube.html" rel="noreferrer">http://framework.zend.com/manual/en/zend.gdata.youtube.html</a></p> <p>State that I can retrieve videos uploaded by a user, but ideally I want to use the query method to limit the results for a pagination.</p> <p>The query method is on the Zend framework docs (same page as before under the title 'Searching for videos by metadata') and is similar to this:</p> <pre> <code> $yt = new Zend_Gdata_YouTube(); $query = $yt->newVideoQuery(); $query->setTime('today'); $query->setMaxResults(10); $videoFeed = $yt->getUserUploads( NULL, $query ); </code> </pre> <p><code> print <code>'&lt;ol&gt;'; foreach($videoFeed as $video): print '&lt;li&gt;' . $video-&gt;title . '&lt;/li&gt;'; endforeach; print '&lt;/ol&gt;'</code>; </code></p> <p>The problem is I can't do $query->setUser('bbc'). </p> <p>I tried setAuthor but this returns a totally different result.</p> <p>Ideally, I want to use the query method to grab the results in a paginated fashion.</p> <p>How do I use the $query method to set my limits for pagination?</p> <p>Thanks. </p>
    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. 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