Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 14th Apr 2011, 08:13 AM   #1
Tom Campbell
War Room Member
 
Join Date: 2007
Location: Seattle, WA
Posts: 450
Thanks: 328
Thanked 155 Times in 77 Posts
Blog Entries: 16
Default
Programmatically determine Page Rank from a PHP script?
Share on: 
fb share twitter share gplus share more share

Is there a way to programmatically determine Page Rank from a PHP script?

thanks--

TC
tomcam is offline  
Unread 14th Apr 2011, 08:26 AM   #2
Mkj
HyperActive Warrior
 
Join Date: 2011
Posts: 198
Thanks: 3
Thanked 19 Times in 19 Posts
Default
Re: Programmatically determine Page Rank from a PHP script?
Share on: 
fb share twitter share gplus share more share

Not sure I follow you but there are freebee code snippets that display page rank. Do a google search for 'prchecker' and use the top result. They supply some code that you can add to display a website page rank.
Mkj is offline  
Unread 17th Apr 2011, 02:35 AM   #3
Active Warrior
War Room Member
 
kaido's Avatar
 
Join Date: 2009
Posts: 48
Thanks: 1
Thanked 7 Times in 7 Posts
Default
Re: Programmatically determine Page Rank from a PHP script?
Share on: 
fb share twitter share gplus share more share

Here you go

PHP Code:
function get_pr()
{
     = -
1;
    
     = 
curl_init();
    
curl_setopt(, CURLOPT_URL, 'http://www.google.com/search?client=navclient-auto&ch='.CheckHash(hashURL()).'&features=Rank&q=info:'..'&num=100&filter=0');
    
curl_setopt(, CURLOPT_TIMEOUT, 60);
    
curl_setopt(, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 GTB6 (.NET CLR 3.5.30729)"); 
    
curl_setopt(, CURLOPT_SSL_VERIFYHOST, false);
    
curl_setopt(, CURLOPT_SSL_VERIFYPEER, false);
    
curl_setopt(, CURLOPT_HEADER, false);
    
curl_setopt(, CURLOPT_FOLLOWLOCATION, true);
    
curl_setopt(, CURLOPT_RETURNTRANSFER, true);
    
     = 
curl_exec();
     = array(
'/ss+/','/v/');
     = 
preg_replace(, ' ', );
    
    if()
    {
         = 
strpos(, "Rank_");
        if( === 
false)
        {
             = 
"N/A";
        }
        else
        {
             = 
substr(,  + 9);
        }
        if( == 
"-1")
        {
             = 
"N/A";
        }
        return ;
    }
    else
    {
         = 
"N/A";
        return ;
    }
}

function 
strToNum(, , ) 
{
     = 
4294967296;
     = 
strlen();
    for ( = 
0;  < ; ++)
    {
         *= ;
        if ( >= )
        {
             = ( -  * (int) ( / ));
             = ( < -
2147483648)? ( + ) : ;
        }
         += 
ord();
    }
    return ;
}

function 
hashURL() 
{
     = 
strToNum(, 0x1505, 0x21);
     = 
strToNum(, 0, 0x1003F);

     >>= 
2;
     = (( >> 
4) & 0x3FFFFC0 ) | ( & 0x3F);
     = (( >> 
4) & 0x3FFC00 ) | ( & 0x3FF);
     = (( >> 
4) & 0x3C000 ) | ( & 0x3FFF);

     = (((( & 
0x3C0) << 4) | ( & 0x3C)) <<2 ) | ( & 0xF0F );
     = (((( & 
0xFFFFC000) << 4) | ( & 0x3C00)) << 0xA) | ( & 0xF0F0000 );

    return ( | );
}

function 
checkHash()
{
     = 
0;
     = 
0;

     = 
sprintf('%u', ) ;
     = 
strlen();

    for( =  - 
1;  >= 0;  --)
    {
         = ;
        if (
1 === ( % 2))
        {
             += ;
             = (int)( / 
10) + ( % 10);
        }
         += ;
         ++;
    }

     %= 
10;
    if(
0!== )
    {
         = 
10 - ;
        if (
1 === ( % 2) )
        {
            if (
1 === ( % 2))
            {
                 += 
9;
            }
             >>= 
1;
        }
    }
    return 
'7'..;
} 
Call as get_pr("YOURURLHERE");

kaido is offline  
The Following User Says Thank You to kaido For This Useful Post:
Unread 17th Apr 2011, 11:35 AM   #4
Tom Campbell
War Room Member
 
Join Date: 2007
Location: Seattle, WA
Posts: 450
Thanks: 328
Thanked 155 Times in 77 Posts
Blog Entries: 16
Default
Re: Programmatically determine Page Rank from a PHP script?
Share on: 
fb share twitter share gplus share more share

Doh! Of course! Thank you, kaido!
tomcam is offline  
Closed Thread


Bookmarks

Tags
determine, google pr, page, page rank, pagerank, php, programmatically, rank, script


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 09:12 AM.