SEO – Meta details from list of URLS

This is a simple tool which was particularly built for my friend who is a great SEO tech. His nature of work involves visiting various links and preparing a excel with the meta description(keywords), title of that link. So we planned for building a tool which can automatically grab all the meta and title information of various links provided in the excel/text document.

Just 3 Steps

1) Upload your text or excel(CSV format)
2) Click Generate button. (Depends on the number of URL links, it takes some time)
3) You can see a link called “Download”. Click and save wherever you want 🙂

 

“;
$data.= “

Link Title Description Keywords

“;

while(!feof($file))
{
$link = fgets($file);

//echo $link;
//urlgetdata($link);
$html = file_get_contents_curl($link);

//parsing begins here:
$doc = new DOMDocument();
@$doc->loadHTML($html);
$nodes = $doc->getElementsByTagName(‘title’);

//get and display what you need:
$title = $nodes->item(0)->nodeValue;

$metas = $doc->getElementsByTagName(‘meta’);

$keywords = “”;
$description = “”;
for ($i = 0; $i < $metas->length; $i++)
{
$meta = $metas->item($i);
if($meta->getAttribute(‘name’) == ‘description’)
$description = $meta->getAttribute(‘content’);
if($meta->getAttribute(‘name’) == ‘keywords’)
$keywords = $meta->getAttribute(‘content’);
}

$data.= “

“;
$data.= “

$link

“;
$data.= “

$title

“;
$data.= “

$description

“;
$data.= “

$keywords

“;
$data.= “

“;
unset($meta);
unset($metas);

}
$data.= “

“;
fclose($file);

file_put_contents(“examples/grab meta info/downloads/$exportFile”, $data);

echo “

Download your Excel here Download

“;

}

function file_get_contents_curl($url)
{

$url = trim($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT,”Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”);
$htmlData = curl_exec($ch);
$header = curl_getinfo($ch);
curl_close($ch);
return $htmlData;
}
?>

Source code