2011-07-03 31 views

回答

0

如果你可以得到结果到一个数组中,你可以通过调用array_reverse()来颠倒顺序。

+0

那么,在这个特定的搜索有3900 +结果。然后,我的下一个尝试是使用setStartIndex来获取高数字,但由于某种原因,API不会让您请求超过1000的任何数据。解决方案躲过了我。当我一页页接一页时,它以800个结果封锁我。 – Cooter

+0

我认为你可能会遇到这种简单的方法。您可以将所有信息吸收到您自己的数据库中(适当时添加新项目)。然后你可以用你认为合适的方式查询你自己的数据库。 – evan

+0

同意。我会继续,并标记这个答案,所以它不会挂在那里。 - 谢谢 – Cooter

1

我知道我有点晚了,但我有同样的问题。我的方法(如果我发现API不提供这个)只需要使用'start-index'来请求最后一部分。这有点烦人,但可能。

$feedURL = 'http://gdata.youtube.com/feeds/api/videos?q='. $query .'author=' . $author; 
$sxml = simplexml_load_file($feedURL); 
$ind = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/')->totalResults; 
$feedURL = 'http://gdata.youtube.com/feeds/api/videos?q='. $query . 
      'author='. $author .'orderby=published'. 
      '&max-result=100&start-index=' . ($ind-100); 
/* save to some array and use. */ 
  • 如果你发现了一个更简单的方法 - 我会很高兴知道。
相关问题