Someone recently asked for a way to quickly pull basic page info from a website, so I thought I’d go ahead and share the code for a very easy PHP script that will retrieve the page title, meta keywords and meta description for any website.
<?php
$url = “http://www.shamwow.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”;
?>
There’s your basic script. Replace where it says www.shamwow.com with whatever site you want to pull data from. The results will look like this:
URL: http://www.shamwow.com
Title: ShamWow¬Æ Official Website – Holds 12 Times Its Weight In Liquid
Description: You’ll Be Saying Wow Every Time!
Keywords:You’ll Be Saying Wow Every Time!, official tv website, as seen on tv
Where to go from here? There are millions of different uses from SERP reporting to page title & keyword comparison. Heck, you could even throw a form on it and present it as an SEO tool on your website (almost every ‘toolset’ you find online has something similar)….

Here’s a useful free service that will email you if your website ever lands on page one of Google, Yahoo or MSN Live. It’s called Exactfactor and for now it’s completely free of charge. All you have to do is setup a basic user account and you’re all set!
You can even set it to where you’ll get an email if another website (i.e. competition) passes you or your rank changes significantly. If you want it to this site can even send you a weekly SERP update via email. It’s limited to only three keywords/phrases per site, but even that should be useful enough when spanned out across a large collection of websites that you’re trying to monitor.
Go check it out while it’s still in beta (i.e still free).. no code or invitation required.
