(.*)<\/title>#is',$xml,$resultTitre); $titre = $resultTitre[count($resultTitre)-1]; //description preg_match('#(.*)<\/content>#is',$xml,$resultDescription); $description = $resultDescription[count($result)-1]; //Image $img = "http://img.youtube.com/vi/".$id."/1.jpg"; //Code HTML $code = ''; } else if ($type=="dailymotion"){ $tags = get_meta_tags("http://www.dailymotion.com/video/".$id); //titre $titre = htmlspecialchars(trim(str_replace("Dailymotion -","",$tags[ "title"]))); //description $description = $tags["description"]; //image $img = "http://www.dailymotion.com/thumbnail/160x120/video/".$id; // code HTML $code = '
' . ''; } else if ($type=="google"){ $xml_string = @file_get_contents( "http://video.google.com/videofeed?docid=".$id); //titre $xml_title_debut = explode("",$xml_string,2); $xml_title_fin = explode("",$xml_title_debut[1],2); $titre = $xml_title_fin[0]; //description $xml_description_debut = explode("",$xml_string,2); $xml_description_fin = explode("",$xml_description_debut[1 ],2); $description = $xml_description_fin[0]; //image $xml_image_debut = explode('<img src="',$xml_string,2); $xml_image_fin = explode('" width="',$xml_image_debut[1],2); $img = $xml_image_fin[0]; //code HTML $code = ' '; } else if ($type=="vimeo"){ $xml_string = @file_get_contents("http://vimeo.com/api/clip/".$id.".xml" ); //titre $xml_title_debut = explode("",$xml_string,2); $xml_title_fin = explode("",$xml_title_debut[1],2); $titre = $xml_title_fin[0]; //description $xml_description_debut = explode("",$xml_string,2); $xml_description_fin = explode("",$xml_description_debut[1],2) ; $description = $xml_description_fin[0]; //image $xml_image_debut = explode("",$xml_string,2); $xml_image_fin = explode("",$xml_image_debut[1],2); $img = $xml_image_fin[0]; //code HTML $xml_code = @file_get_contents( "http://vimeo.com/api/oembed.xml?url=http%3A//vimeo.com/".$id); $xml_code_debut = explode("",$xml_code,2); $xml_code_fin = explode("",$xml_code_debut[1],2); $code = str_replace("","",$xml_code_fin[0] )); } return array("id"=>$id,"type"=>$type,"titre"=>$titre,"description"=> $description,"img"=>$img,"code"=>$code); } ?>