Free google keyword rank checker. Insert your domain name and keyword, you will find your rank if you are at top 10 pages. If you found your rank is 26 , that mean you are at page 2.
Find your google keyword rank
”) {
$_SESSION[‘domain’] = $_POST[‘domain’];
$_SESSION[‘keyword’] = $_POST[‘keyword’];
$_POST[‘domain’]=”;
$_POST[‘keyword’]=”;
main();
}
function main (){
$homepage=0;
$ip=get_the_user_ip();
$domain = $_SESSION[‘domain’];
$key = $_SESSION[‘keyword’];
session_destroy ();
$upload_dir = wp_upload_dir();
$dir = $upload_dir[‘basedir’].”/seo/”;
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
}
$dir = $dir.”$ip”;
// echo $dir;
if (!file_exists(“$dir”)) {
$file = fopen(“$dir”,”w”);
echo fwrite($file,”1″);
fclose($file);
}
else
{
deleteOldFile($dir); // Delete files older then today
$homepage = file_get_contents($dir);
$homepage++;
if ($homepage == 11 ) {
echo ”
Sorry, 10 search per day
“;
}
else
{
$position = position($domain,$key,10);
echo ”
position $position”;
if ($positio > 200) echo ”
Keyword not found in first 10 pages Keyword : $key Domain : $domain
“;
else echo ”
Keyword : $key
Domain : $domain
Rank : $position
“;
echo ”
Search limit 10 , Currently searching $homepage
“;
file_put_contents($dir, $homepage);
}
}
}
function position($site,$search_query,$end){
$search_query = str_replace(‘ ‘, ‘%20’, $search_query );
$end = $end * 10;
$key = “AIzaSyA-dg-22b1jqzkfSPENomEXgQrgSLCe3sE”;
$cx=”013580894861529191629:hix6bvfkjbw&alt”;
$rank=1;
for ($start=1;$start=>$end; $start=$start+10){ $count=$start+10; $amazon_url= “https://www.googleapis.com/customsearch/v1?key=”.$key.”&cx=”.$cx.”=json&start=”.$start.”&count=”.$count.”&q=”.$search_query; $amazon_url = str_replace(‘ ‘, ”, $amazon_url); //echo $amazon_url; $google_search = file_get_contents($amazon_url) ;//or die(print_r(error_get_last())); $jsonstore = json_decode($google_search,true); foreach ($jsonstore[‘items’] as $address){ sleep(.01); if (strpos($address[‘displayLink’], $site) > 0)
{
$search_query = str_replace(‘%20′,’ ‘, $search_query );
//echo ”
“. $search_query .” rank is “. $rank;
$start=$end;
return $rank;
}
//echo “items $rank:” . $address[‘displayLink’] .”
“;
$rank++;
}
}
return 9999;
}
function deleteOldFile($file) {
$mdate = date(“Ymd”, filemtime($file));
$date = date(“Ymd”);
if ($mdate = $date) { unlink($file); } } ?>