For anyone else who might need vimeo integration, here are some snippets I’ve thrown together.
(You can see them in action at
http://new.wheelhousenyc.com)
VimeoAlbum will pull in an album from Vimeo, complete with links, thumbnails, descriptions, etc.
Call it with
[tt][[VimeoAlbum?albumID=`VimeoAlbumID`]][/tt] -- get your album id from the URL for an album on vimeo.com
Snippet code: (I’m using zoombox -- it works great to create a popup player)
<?php
$output = '';
$albumData = unserialize(file_get_contents("http://vimeo.com/api/v2/album/$albumID/videos.php"));
$output .= '<div class="VimeoAlbum">
';
foreach ($albumData as $vid) {
$output .= ' <div class="VimeoAlbumItem">';
$output .= ' <a href="'.$vid['url'].'" title="'.$vid['title'].'" rel="zoombox[group]">';
$output .= ' <img src="'.$vid['thumbnail_medium'].'">';
$output .= ' <div class="VimeoAlbumItemCaption">'.$vid['title'].'</div>';
$output .= ' <div class="VimeoAlbumItemDescription">'.$vid['description'].'</div>';
$output .= ' </a>';
$output .= ' </div>
';
}
$output .= '</div>';
return $output;
VimeoMostRecent will return the id for the most recent video from a given album.
(You can change ’id’ to ’url’ if you want to retrieve the link to the video)
Call it with
[tt][[VimeoMostRecent?albumID=`VimeoAlbumID`]][/tt]
<?php
$albumData = unserialize(file_get_contents("http://vimeo.com/api/v2/album/$albumID/videos.php"));
return $albumData[0]['id'];
VimeoThumbURL will return the thumbnail for a given Vimeo Video ID:
<?php
$vdata = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$VimeoVideoID.php"));
return $vdata[0]['thumbnail_medium'];
You can learn more about the kind of data you can pull here:
http://vimeo.com/api/docs/simple-api
CAVEAT: This will only return the first 20 videos in a given album, and will not return any videos whose privacy is hidden!