Jak pobrać ilość filmów konkretnego użytkownika z YT? (potrzebne mi do podziału na strony)
Szukam i jakoś nie mogę do tego dojść.
pzdr
<?php $yt = new Zend_Gdata_YouTube(); $videoFeed = $yt->getUserFavorites('John Doe'); $video_count = $videoFeed->getTotalResults(); ?>
<?php $videoFeed = $yt->getUserUploads('John Doe'); //nie ulubione $video_count = $videoFeed->getTotalResults()->getText(); //żeby mieć string, a nie object ?>
<?php $commentFeed = $yt->getVideoCommentFeed($videoId); $comments = $commentFeed->getTotalResults()->getText(); ?>
<?php $f = 1; $c = 25; $comments = 0; while ($c == 25) { $query = $yt->newVideoQuery('http://gdata.youtube.com/feeds/api/videos/'.$videoId.'/comments'); $query->setStartIndex($f); $commentFeed = $yt->getVideoFeed($query); $total = $commentFeed->getTotalResults()->getText(); if ($total == 25) { $comments += 25; $f += 25; } else { $comments += $total; $c = 0; } } ?>