//GETS INFO FROM ADRESS EG ?creator=1
$frm_ytstring = "http://www.youtube.com/watch?v=jr3JEwXtudA";
$checkyt = explode(".", $frm_ytstring);//Bad xml parsing
$gotcheckyt = $checkyt[1];
//if ($gotcheckyt == "youtube" ){
//gets vid id
$yt_start = explode("v=",$frm_ytstring,2);
$yt_end = explode("&",$yt_start[1],2);
$gotid = $yt_end[0];
//youtube xml setup
$getinfoytlink = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=BnvzCjJ_Bzw&video_id=$gotid";
//this page gets xml info off utube
$yt_xml_pic_string = @file_get_contents($getinfoytlink);
$yt_xml_pic_start = explode("",$yt_xml_pic_string,2);
$yt_xml_pic_end = explode("",$yt_xml_pic_start[1],2);
$yt_pic = $yt_xml_pic_end[0];
echo "piclink:".$yt_pic."
";
//echo $yt_pic;
$yt_xml_author_string = @file_get_contents($getinfoytlink);
$yt_xml_author_start = explode("",$yt_xml_author_string,2);
$yt_xml_author_end = explode("",$yt_xml_author_start[1],2);
$yt_author = addslashes($yt_xml_author_end[0]);
echo "author:".$yt_author."
";
//echo $yt_author;
$yt_xml_title_string = @file_get_contents($getinfoytlink);
$yt_xml_title_start = explode("",$yt_xml_title_string,2);
$yt_xml_title_end = explode("",$yt_xml_title_start[1],2);
$yt_title = addslashes($yt_xml_title_end[0]);
$yt_title_noslash = $yt_xml_title_end[0];
echo "title:".$yt_title_noslash."
";
//echo $yt_title."
";
$yt_xml_description_string = @file_get_contents($getinfoytlink);
$yt_xml_description_start = explode("",$yt_xml_description_string,2);
$yt_xml_description_end = explode("",$yt_xml_description_start[1],2);
$yt_description = addslashes($yt_xml_description_end[0]);
echo "description:".$yt_description."
";
//echo $yt_description."
";
$yt_xml_view_count_string = @file_get_contents($getinfoytlink);
$yt_xml_view_count_start = explode("",$yt_xml_view_count_string,2);
$yt_xml_view_count_end = explode("",$yt_xml_view_count_start[1],2);
$yt_view_count = $yt_xml_view_count_end[0];
echo "view count:".$yt_view_count."
";