Hello I have a working code
<?php
$url = "http://www.youtube.com";
$fp = fopen( $url, ‘r’ );
$content = "";
while( !feof( $fp ) ) {
$buffer = trim( fgets( $fp, 4096 ) );
$content .= $buffer;
}
$start = '<title>';
$end = '<\/title>';
preg_match( "/$start(.*)$end/s", $content, $match );
$title = $match[ 1 ];
$metatagarray = get_meta_tags( $url );
$keywords = $metatagarray[ "keywords" ];
$description = $metatagarray[ "description" ];
echo "<div><strong>URL:</strong> $url</div>\n";
echo "<div><strong>Title:</strong> $title</div>\n";
echo "<div><strong>Description:</strong> $description</div>\n";
echo "<div><strong>Keywords:</strong> $keywords</div>\n";
?>
It fetches title description and keywords from a url.
My question is how can I use it with a youtube video Url
for example if I put http://www.youtube.com/v/ILWSp0m9G2U as a url I get many errors.
Any help is appreciated!
Thanks