I'm using this php code to get the thumbnail images of Vimeo videos.
while($row = $database->fetch_array($result))
{
$url = $row["link"];
sscanf(parse_url($url, PHP_URL_PATH), '/%d', $video_id);
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$video_id.php"));
$image = $hash[0]['thumbnail_small'];
echo "<img class='vimeo_video' video='$video_id' src=$image>";
}
It fetches the images, but it takes at least 30 seconds to load the page. Is it something to do with Vimeo's servers or my code?