Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 807801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:27:38+00:00 2026-05-15T00:27:38+00:00

I want to grab a user’s uploads (ie: BBC) and limit the output to

  • 0

I want to grab a user’s uploads (ie: BBC) and limit the output to 10 per page.

Whilst I can use the following URL:
http://gdata.youtube.com/feeds/api/users/bbc/uploads/?start-index=1&max-results=10

The above works okay.

I want to use the query method instead:

The Zend Framework docs:
http://framework.zend.com/manual/en/zend.gdata.youtube.html

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.

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:


$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->setTime('today');
$query->setMaxResults(10);
$videoFeed = $yt->getUserUploads( NULL, $query );


print '<ol>';
foreach($videoFeed as $video):
print '<li>' . $video->title . '</li>';
endforeach;
print '</ol>'
;

The problem is I can’t do $query->setUser(‘bbc’).

I tried setAuthor but this returns a totally different result.

Ideally, I want to use the query method to grab the results in a paginated fashion.

How do I use the $query method to set my limits for pagination?

Thanks.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:27:38+00:00Added an answer on May 15, 2026 at 12:27 am

    I basically solved this in the same way as worchyld with a slight twist:

        $username = 'ignite';
        $limit = 30;  // Youtube will throw an exception if > 50
        $offset = 1;  // First video is 1 (silly non-programmers!)
        $videoFeed = null;
        $uploadCount = 0;
        try {
            $yt = new Zend_Gdata_YouTube();
            $yt->setMajorProtocolVersion(2);
            $userProfile = $yt->getUserProfile($username);
            $uploadCount = $userProfile->getFeedLink('http://gdata.youtube.com/schemas/2007#user.uploads')->countHint;
    
            // The following code is a dirty hack to get pagination with the YouTube API without always starting from the first result
            // The following code snippet was copied from Zend_Gdata_YouTube->getUserUploads();
            $url = Zend_Gdata_YouTube::USER_URI .'/'. $username .'/'. Zend_Gdata_YouTube::UPLOADS_URI_SUFFIX;
            $location = new Zend_Gdata_YouTube_VideoQuery($url);
            $location->setStartIndex($offset);
            $location->setMaxResults($limit);
            $videoFeed = $yt->getVideoFeed($location);
        } catch (Exception $e) {
            // Exception handling goes here!
            return;
        }
    

    The Zend YouTube API seems silly as the included getUserUploads method never returns the VideoQuery instance before it actually fetches the feed, and while you can pass a location object as a second parameter, it’s an “either-or” situation – it’ll only use the username parameter to construct a basic uri or only use the location, where you have to construct the whole thing yourself (as above).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to grab the User Object in Joomla in another PHP script. Anway,
I want to grab what a user is typing and display in a span
I'd like to get a script that can grab the user's user agent and
I want to grab a date entered by the user, but only the day,
I am the owner of a facebook like page. I want to grab the
I have a simple use case where I want to grab a session variable
I want to grab some elements of a page using jQuery and ajax...no problem.
Using Paperclip, I want to grab an image from a URL like this: require
I want to grab my customers phone number from a MYSQL database and auto
I want to grab the most recent entry from a table. If I was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.