代码之家  ›  专栏  ›  技术社区  ›  Paulo Bueno

youtube gdata api使用$yt->newvideoquery检索收藏夹

  •  1
  • Paulo Bueno  · 技术社区  · 16 年前

    也许这是一个不常见的问题,但现在我们开始。下面是代码

    $userName=("Google");
    $yt = new Zend_Gdata_YouTube();
    
    $query = $yt->newVideoQuery();
    $query->setAuthor($userName);
    $query->setMaxResults(3);
    $query->setStartIndex(2);
    printVideoFeed($yt->getVideoFeed($query));
    

    而且效果很好。但我的客户也希望包括他的最爱名单。

    应该可以使用

    printVideoFeed($yt->getUserFavorites($userName));
    

    但是这样做我就无法控制分页。

    有什么想法吗?

    1 回复  |  直到 16 年前
        1
  •  2
  •   Jay Zeng    16 年前

    你不能用吗 $yt->getUserFavorites($userName); 要检索用户的收藏夹?

    或者,您可以使用javascript控制分页,计算dom元素的数量,然后执行逻辑

    推荐文章