【发布时间】:2013-05-21 11:24:51
【问题描述】:
我知道 *wp_remote_get* 是一个 WordPress 函数,我应该将它发布在 wordpress.stackexchange 中,但是,我几乎可以肯定我的问题更多地在于一般的 PHP 方面。
问题:我需要检索在相册中找到的所有 Vimeo 视频,但我只有 20 个。
方法:
$vmg_feed_url = 'http://vimeo.com/api/v2/';
$vmg_user = '2212323';
if($vmg_type == 'user'){ /** just an input variable checking whether the function should search for user or for album. in our case, it searches for album **/
$vmg_type_url = '';
} else {
$vmg_type_url = $vmg_type . '/';
}
$vmg_videos_url = $vmg_feed_url . $vmg_type_url . $vmg_user . '/videos.xml';
$videos_result = wp_remote_get($vmg_videos_url);
$vmg_videos = simplexml_load_string($videos_result['body']);
生成的 XML 是 http://vimeo.com/api/v2/album/2212323/videos.xml - 如您所见,我只检索 20 个视频。
问题:我错过了什么吗?是否有一个函数/变量可以限制我可以检索的视频数量?我知道 wp_remote_get 为我提供了这些属性 (from the WordPress Codex):
$url (字符串)(必需)通用资源定位器 (URL)。 - 默认:无
$args (数组)(可选) - 默认:方法:GET,超时:5,重定向:5,httpversion:1.0,阻塞:true,标头:array(),正文:null,cookie:array()
非常感谢任何帮助。如果我忘记了任何细节,请告诉我!
【问题讨论】: