Google PageRank Script New Updated toolbar query url

Saturday, October 8, 2011

Due to the problem on PR Finding script. When we identify the problem of this script, I have found that query URL been changed by Google which we fetch PR problematically. Here is the updated Google PageRank Script New Updated toolbar query URL

The Old URL Was This -
http://toolbarqueries.google.com/search?client=navclient-auto&features=Rank&ch=SITECHECKSUM&q=info:SITENAME.com

The New URL Is This -
http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank&ch=SITECHECKSUM&q=info:SITENAME.com

# Desc: function to check the Given URL with http:// and fetch PR
# Param: $url as String
# Depen: fetch_google_page_rank
# Return: Gogole Rank as Integer
function fetch_google_page_rank($url) {
 $url = strstr($url,"http://")? $url:"http://".$url;
    $fp = fsockopen("toolbarqueries.google.com", 80, $errno, $errstr, 30);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
        } else {
        $out = "GET /tbr?client=navclient-auto&ch=".
CheckHash(HashURL($url))."&features=Rank&q=info:".$url."&num=100&filter=0 HTTP/1.1\r\n";
        $out .= "Host: toolbarqueries.google.com\r\n";
        $out .= "User-Agent: Mozilla/4.0 (compatible; GoogleToolbar 2.0.114-big; Windows XP 5.1)\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);

        while (!feof($fp)) {
            $data = fgets($fp, 128);
            $pos = strpos($data, "Rank_");
        if($pos === false){} else{
                $pagerank = substr($data, $pos + 9);
            }
        }
        fclose($fp);
        return (int)$pagerank;
    }
}


New Updated Live Demo and Script

Download This Script     Live Demo     Download Script

5 comments:

Mike K. said...
This comment has been removed by the author.
Mike K. said...

None of the 3rd party toolbars were displaying PR for me, but I knew that the Google Toolbar still had accurate PR. Problem is, Google Toolbar is compatable with Firefox 4.0 and lower (current version is 7.01). After much tinkering, I was able to trick the toolbar into working with all current versions of Firefox. I wrote up a brief guide if anyone else wants to get this problem fixed, check it out here: www.landofjacks.com/forum/viewtopic.php?f=36&t=76

Hope this helps some of you guys, cause I know it was driving me nuts!

Rob said...

Thank you verry much!

Parijat said...

Thanks a lot, works crystal clear. I was wondering for a long time

chaithu said...

Thanks a lot man. really help full.

Post a Comment