vimeo through json in php
I was trying to get some data from vimeo using their simple api and json.
here's how I got the data
$contents = file_get_contents('http://vimeo.com/api/v2/user'.$user.'/videos.json')
I decoded/converted it to an array
$data = json_decode($contents);
then I tried to get the thumbnail_medium information, and this is when I ran into a problem. The $data is an array (length = num of videos) but each object is a stdClass. I thought i could access the data easily through this easily but I had a hard time doing that. The trick is to type the stdClass to an array.
$video = (array) $feed[$video_num];
voila
0 Comments
Posted on 2009 Sep 03 by
Daniel