86400) { $handle = fopen($url, "rb"); if ($handle) { $fp = fopen("cache/youtube.php","w"); fwrite($fp,"\n"); fclose($fp); fclose($handle); } } include 'cache/youtube.php'; $xml = new SimpleXMLElement($xmlstr); /* For each node. */ $i = 0; foreach ($xml->entry as $item) { $id = $item->xpath('yt:videoId'); $vid = (string)$id[0]; // var_dump($item); echo "/*\n"; $media = $item->xpath('media:group'); //var_dump($media); $desc = $item->xpath('//media:description'); //var_dump($desc); echo "\n*/\n"; $title = $item->title; $url = $item->link["href"]; echo "document.write('

".str_replace("'","\\'",stripslashes($title)).">

\\n');\n"; //echo "\n"; //echo "\n"; echo "document.write('
".str_replace("'","\\'",stripslashes(str_replace("\n","
",$desc[$i])))."
\\n');\n"; echo "document.write('');\n"; $i++; } ?>