Is there a limit to wp_remote_get and/or simplexml_load_string from Vimeo?


Staff member
I know *wp_remote_get* is a WordPress function, and that I should be posting this in wordpress.stackexchange, however, I am almost certain my issue lies more on the general PHP side.

<strong>The problem:</strong> I need to retrieve all Vimeo videos found within an album, yet I am only getting 20.

<strong>The approach:</strong>

$vmg_feed_url = '';
$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']);

The resulting XML is <a href="" rel="nofollow"></a> - and as you can see, I am only retrieving 20 videos.

<strong>The question:</strong> Am I missing something? Is there a function/variable that sets a limit to the amount of videos I can retrieve? I know that <strong>wp_remote_get</strong> gives me these attributes (<a href="" rel="nofollow">from the WordPress Codex</a>):

(string) (required) Universal Resource Locator (URL).
- <em>Default</em>: None

(array) (optional)
- <em>Default</em>: method: GET, timeout: 5, redirection: 5, httpversion: 1.0, blocking: true, headers: array(), body: null, cookies: array()

Any help is truly appreciated. Please let me know if I forgot about any details!