Created
April 20, 2013 12:21
-
-
Save willtonkin/5425822 to your computer and use it in GitHub Desktop.
Generate list of Vimeo videos from array of Vimeo IDs. Uses Vimeo API to grab thumbnail and video title.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="list"> | |
<ul> | |
<?php | |
function drawVimeoPanel( $vimeo_id ) | |
{ | |
$request_url = "http://vimeo.com/api/v2/video/" . $vimeo_id . ".xml"; | |
$video_info = simplexml_load_file( $request_url ); | |
$v = '<li>'; | |
$v .= '<a href="http://player.vimeo.com/video/' . $vimeo_id . '">'; | |
$v .= '<img src="' . $video_info->video[0]->thumbnail_large . '">'; | |
$v .= '<p>' . $video_info->video[0]->title . '</p>'; | |
$v .= '</a>'; | |
$v .= '</li>'; | |
echo $v; | |
} | |
$vimeo_ids = array( 23608259 ); | |
foreach ( $vimeo_ids as $id ) | |
drawVimeoPanel( $id ); | |
?> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment