1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PageRank Checker Fix for recent google URI change

Discussion in 'PHP' started by ROOFIS, Oct 6, 2011.

  1. #1
    Recently google's toolbar and pagerank checker sites have been showing pagerank (NA) for all sites across the web.
    Thanks to iqbalsandira post: forums.digitalpoint.com/showthread.php?t=2298331
    it seems to be a URI pathway update.

    Change search? query parameter to tbr? (I'm guessing this is google's abbr for ToolBarRank) :eek:

    eg:
    http://toolbarqueries.google.com/[COLOR="#0000FF"]search?[/COLOR]client=navclient-auto&ch=783326521420&features=Rank&q=info:google.com
    
    changed to:
    
    http://toolbarqueries.google.com/[COLOR="#0000FF"]tbr?[/COLOR]client=navclient-auto&ch=783326521420&features=Rank&q=info:google.com 
    Code (markup):

    Below is a pseudocode with URI mod included for you to save on http://local or web server. NOTE* hash should work on most servers and on 64bit native environments.

    <pre>
    <?php
    #licence: public domain.
    //=====================================Hash Function Start=====================================//
    function stringToNumber($str,$chk,$mag){$len=strlen($str);
    for($i=0;$i<$len;$i++){$chk*=$mag;
    if($chk>=4294967296){
    $chk=($chk-4294967296*(int)($chk/4294967296));
    $chk=($chk<-(4294967296/2))?($chk+4294967296):$chk;}
    $chk+=ord($str{$i});}
    return$chk;}
    function createHash($str){
    $chk1=stringToNumber($str,0x1505,0x21);
    $chk2=stringToNumber($str,0,0x1003F);
    $HfFact=4/2;$chk1>>=$HfFact;
    $chk1=(($chk1>>4)&0x3FFFFC0)|($chk1&0x3F);
    $chk1=(($chk1>>4)&0x3FFC00)|($chk1&0x3FF);
    $chk1=(($chk1>>4)&0x3C000)|($chk1&0x3FFF);
    $calc1=(((($chk1&0x3C0)<<4)|($chk1&0x3C))<<$HfFact)|($chk2&0xF0F);
    $calc2=(((($chk1&0xFFFFC000)<<4)|($chk1&0x3C00))<<0xA)|($chk2&0xF0F0000);
    return($calc1|$calc2);}
    function checkHash($HshNum){$chk=0;$Fg=0;
    $HshStr=sprintf("%u",$HshNum);
    $len=strlen($HshStr);
    for($i=$len-1;$i>=0;$i--){$r=$HshStr{$i};
    if(1===($Fg%2)){$r+=$r;$r=(int)($r/10)+($r%10);}$chk+=$r;$Fg++;}$chk%=10;
    if(0!==$chk){$chk=10-$chk;
    if(1===($Fg%2)){
    if(1===($chk%2)){
    $chk+=9;}$chk>>=1;}}
    return"7".$chk.$HshStr;}
    //======================================Hash Function End======================================//
    //construct query URI
    
    $arr1=array_unique(file("CK_PR_For_URLS.txt",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES));			
    foreach($arr1 as&$val){
    $valX=$val;
    $val=checkHash(createHash(($val)));
    $val="<a href='http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=".$val."&features=Rank&q=info:".$valX."' target='_blank'>http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=".$val."&features=Rank&q=info:".$valX."</a>";
    }
    unset($val);
    echo "<small><small>";
    print_r(implode(PHP_EOL, $arr1));
    echo "</small></small>";
    
    ?>
    </pre>
    PHP:

    On the same directory level add a .txt file with the domains you wish to query for pageranks titled: CK_PR_For_URLS.txt
    you may need to utilize brute force submission as some of the queries return null.


    eg: in your file CK_PR_For_URLS.txt you may need to generate the following:

    google.com
    www.google.com
    http://google.com
    http://www.google.com
    google.com/
    www.google.com/
    http://google.com/
    http://www.google.com/
    example.org
    www.example.org
    http://example.org
    http://www.example.org
    example.org/
    www.example.org/
    http://example.org/
    http://www.example.org/
    
    Code (markup):
    Some will return a result some wont.
    Your query page will return complete URI pathways which are clickable. last number is pagerank
    eg: Rank_1:2:10 for google :10 is rank.



    enjoy!! :cool:




    ROOFIS
     
    Last edited: Oct 6, 2011
    ROOFIS, Oct 6, 2011 IP