Videos
// The Simple API URL $api_endpoint = 'http://vimeo.com/api/v2/'; // Curl helper function function curl_get($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 30); $return = curl_exec($curl); curl_close($curl); return $return; } if ($_GET['album']) { // Get the album $album_id = $_GET['album']; // Load the videos and info $videos = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/videos.xml')); $info = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/info.xml')); // Thumbnail and title $image = $info->album->thumbnail; $title = $info->album->title; } else if ($_GET['group']) { // Get the group $group_id = $_GET['group']; // Load the videos and info $videos = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/videos.xml')); $info = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/info.xml')); // Thumbnail and title $image = $info->group->thumbnail; $title = $info->group->name; } else if ($_GET['channel']) { // Get the channel $channel_id = $_GET['channel']; // Load the videos and info $videos = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/videos.xml')); $info = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/info.xml')); // Thumbnail and title $image = null; $title = $info->channel->name; } else { // Change this to your username to load in your videos $vimeo_user_name = ($_GET['user']) ? $_GET['user'] : ''; if ($vimeo_user_name) { // Load the user's videos $videos = simplexml_load_string(curl_get($api_endpoint.$vimeo_user_name . '/videos.xml')); // Thumbnail and title $image = $videos->video[0]->user_portrait_medium; $title = $videos->video[0]->user_name . "'s Videos"; } } if (isset($videos) && count($videos)) { ?>-
video as $video): ?>
-
=$video->title?>
