Home Artikel Web Development Script Management Basic Simple PHP Multi Keyword Google Rank Checker
Free Domain and Free Hosting has been launched. Cheap Domain and Hosting are also available to signup. Very match for your business needs and for your other private necessities. Features started with 300 MB Space, VistaPanel/Cpanel, 7 MySQL Databases, 6 Sub Domains, 6 Addon Domains, FTP Account, POP email accounts, PhpMyAdmin, Web Mail, File Manager, Password protected Folders, Automatic Script Installer and lots of more. Learn More...



Close Panel

Shout Box

Latest Message: 1 day, 13 hours ago
View archive

Guests are shown between [].


Basic Simple PHP Multi Keyword Google Rank Checker PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Bang Igan   
Thursday, 18 December 2008 21:17
I had a couple of commenters on my post about the Google Blogsearch URL Scraper

ask whether it could be turned into a google rank checking script.

Well, in a nutshell, the answer to that question was no, but that’s not to say that the Pimp didn’t have one in his arsenal, and that he’d be prepared to share it!

So here it is, and as always, for those who want to know how it works, the code is extremely well commented (you’re going to need to go in and replace all the single and double quotes after you’ve copied the code below, as wordpress screws them up
 

<?php
ob_start();

//put your site’s URL here, but leave off the http://www
$url = “kematian.biz”;

//put all the keywords you want to check here, make sure you leave the single quotes and commas intact for each keyword
$keywords = array(
‘google scraper’,
‘php script to get pagerank’,
‘Simple PHP Google Bot Cloaking Script’,
);

//Just tells us what URL we’re checking rankings for
echo “<h2> Google SERPS For ” .$url. “</h2>”;

//start to run through each of the keywords
foreach($keywords as $keyword) {

//set our counter at zero, so we can work out what the ranking of the page
$count = 0;

//make a URL that we can query Google with
$search = “http://www.google.com/search?q=” .urlencode($keyword). “&num=100″;

//now go get that page
$google = file_get_contents($search);

//funky regular expression stuff to find our URL in the results
$description= (’/<h3 class=r><a href=\”(.+?)\” class=l/’);
preg_match_all($description,$google,$match);

//start looping through each of the results on the page
foreach( $match[1] as $value){

//Add one to the counter after we check each of the results
$count = $count + 1;

//check each of the 100 results from google, to see if our URL is in it.
if(strstr($value, $url)) {

//if this particular result has our URL in it, print it to the page, along with the ranking ($count variable from above)
echo $keyword. ” - ” .$count. “<br>”;
ob_flush();
flush();
}

}
//Have a bit of a rest before we go check the next keyword, so we don’t get booted from the Goog’
sleep(rand(30,60));
}

?>


And there you have it!

Tomorrow, the same script, but to get Yahoo! results…..

Comments (0)add comment

Write comment

busy

Related news items:
Newer news items:
Older news items:

 

CO.CC:Free Domain