Return to Snippet

Revision: 34338
at October 23, 2010 06:51 by mloberg


Updated Code
<?php
// make sure to replace vimeouser with your vimeo username
$vimeorequest = 'http://vimeo.com/api/v2/vimeouser/videos.json';
$vimeoci = curl_init($vimeorequest);
curl_setopt($vimeoci,CURLOPT_RETURNTRANSFER, TRUE);
$jsondoc = curl_exec($vimeoci);
curl_close($vimeoci);

// parameter 'true' is necessary for output as PHP array
$video = json_decode($jsondoc,true);

// the number of videos we want to display
$videosToShow = 5;

for($i=0;$i<=$videosToShow;$i++){
	echo "<p><a href=\"" . $video[$i]['url'] . "\">" . $video[$i]['title'] . "</a></p>";
	echo "<p><a href=\"" . $video[$i]['url'] . "\"><img src=\"" . $video[$i]['thumbnail_medium'] . "\" alt=\"" . $video[$i]['title'] . "\" /></a></p>";
	echo "<p>" . $video[$i]['description'] . "</p>";
	echo "<hr />\n";
}
?>

Revision: 34337
at October 21, 2010 07:22 by mloberg


Initial Code
<?php
// make sure to replace vimeouser with your vimeo username
$vimeorequest = 'http://vimeo.com/api/v2/vimeouser/videos.json';
$vimeoci = curl_init($vimeorequest);
curl_setopt($vimeoci,CURLOPT_RETURNTRANSFER, TRUE);
$jsondoc = curl_exec($vimeoci);

// parameter 'true' is necessary for output as PHP array
$video = json_decode($jsondoc,true);

// the number of videos we want to display
$videosToShow = 5;

for($i=0;$i<=$videosToShow;$i++){
	echo "<p><a href=\"" . $video[$i]['url'] . "\">" . $video[$i]['title'] . "</a></p>";
	echo "<p><a href=\"" . $video[$i]['url'] . "\"><img src=\"" . $video[$i]['thumbnail_medium'] . "\" alt=\"" . $video[$i]['title'] . "\" /></a></p>";
	echo "<p>" . $video[$i]['description'] . "</p>";
	echo "<hr />\n";
}
?>

Initial URL

                                

Initial Description
This is a very simple use of the Vimeo API. All it does is list the video title, a thumbnail of the video, and the description. More advance script coming later.

Initial Title
Simple Vimeo JSON API Implementation

Initial Tags
php, json, api

Initial Language
PHP