NameSilo

PageRank Code php

Spaceship Spaceship
Watch
Here is the pagerank code. Open to use in public domain...

People selling pagerank site for 20$ + .. Sorry to them.

:kickass:
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Thxs for this file, i will thank you more, if you tell me what this does -_-?
 
0
•••
How exactly do you put this into use? :D
 
0
•••
a quick flick thru it and it simply looks like you just do something like http://domain.com/scriptname.php?url=www.site_name.com

changing domain.com to your domain name, scriptname.php to whatever you called the script and site_name.com to the domain you wish to find the PR of.

Jokez Guy it is a script for finding out what the PR rank of a domain name is. PR (pagerank) is what google partly uses to rank your site, the higher the number the better (goes from 0 - 10).
 
0
•••
Hmm displays something like this:

url: yours
ch: 6380683397 (my pagerank I guess?)

I hope not cause that is just terrible...
 
Last edited:
0
•••
Ok even I am confused now, is this the correct code?

I thought I was using the correct one on www.prlookup.com
 
0
•••
GoolePR.com give me a 3 and this thingy says 6656508260
 
0
•••
Domainut said:
Ok even I am confused now, is this the correct code?

I thought I was using the correct one on www.prlookup.com

this script is meant to retreive it for you instead of using a seperate service such as prlookup.com

prlookup is a very good site for finding your prso if you are happy with that site stick with the way you are doing it now. Bit of course looking at your sig it looks like you already know that :lol:


GoolePR.com give me a 3 and this thingy says 6656508260

the googlepr 1 is obviously the correct 1.
 
0
•••
This will work until Google changes the checksum algorithm which is likely given the spread of such code now.
 
0
•••
So what exactly do these numbers mean?
 
0
•••
Imagine the SE traffic with traffic that high lol.
 
0
•••
The numbers are the checksum value for the intended URL, and what you need to do is use this checksum to connect to the correct server (with the correct parameters) to retrieve the PR. :)
 
0
•••
0
•••
sorry for brining up this old thread, but since none posted how to use this code here is an answer.

as alien pointed out the big number returned are a checksum for url inputed and is to be used in a URL that returns the PR stuff.

copy and paste to a file called google.php, upload to your favourite webserver.

use the script like this google.php?url=http://www.url-to-check.com

the google page linked to will look like

Code:
Rank_1:2:xx

where the xx will be the page rank.

for $25 i can write you a script that can check multiple domains ;)

reservations:

i did not write the code in this script, i just added a part to make it simpler to use.

google might at any time change some stuff around making this script unusable.

this is the stuff you should copy and paste

Code:
<?php 
/* 
    This code is released unto the public domain 
*/ 
header("Content-Type: text/plain; charset=utf-8"); 
define('GOOGLE_MAGIC', 0xE6359A60); 

//unsigned shift right 
function zeroFill($a, $b) 
{ 
    $z = hexdec(80000000); 
        if ($z & $a) 
        { 
            $a = ($a>>1); 
            $a &= (~$z); 
            $a |= 0x40000000; 
            $a = ($a>>($b-1)); 
        } 
        else 
        { 
            $a = ($a>>$b); 
        } 
        return $a; 
} 


function mix($a,$b,$c) { 
  $a -= $b; $a -= $c; $a ^= (zeroFill($c,13)); 
  $b -= $c; $b -= $a; $b ^= ($a<<8); 
  $c -= $a; $c -= $b; $c ^= (zeroFill($b,13)); 
  $a -= $b; $a -= $c; $a ^= (zeroFill($c,12)); 
  $b -= $c; $b -= $a; $b ^= ($a<<16); 
  $c -= $a; $c -= $b; $c ^= (zeroFill($b,5)); 
  $a -= $b; $a -= $c; $a ^= (zeroFill($c,3));    
  $b -= $c; $b -= $a; $b ^= ($a<<10); 
  $c -= $a; $c -= $b; $c ^= (zeroFill($b,15)); 
    
  return array($a,$b,$c); 
} 

function GoogleCH($url, $length=null, $init=GOOGLE_MAGIC) { 
    if(is_null($length)) { 
        $length = sizeof($url); 
    } 
    $a = $b = 0x9E3779B9; 
    $c = $init; 
    $k = 0; 
    $len = $length; 
    while($len >= 12) { 
        $a += ($url[$k+0] +($url[$k+1]<<8) +($url[$k+2]<<16) +($url[$k+3]<<24)); 
        $b += ($url[$k+4] +($url[$k+5]<<8) +($url[$k+6]<<16) +($url[$k+7]<<24)); 
        $c += ($url[$k+8] +($url[$k+9]<<8) +($url[$k+10]<<16)+($url[$k+11]<<24)); 
        $mix = mix($a,$b,$c); 
        $a = $mix[0]; $b = $mix[1]; $c = $mix[2]; 
        $k += 12; 
        $len -= 12; 
    } 

    $c += $length; 
    switch($len)              /* all the case statements fall through */ 
    { 
        case 11: $c+=($url[$k+10]<<24); 
        case 10: $c+=($url[$k+9]<<16); 
        case 9 : $c+=($url[$k+8]<<8); 
          /* the first byte of c is reserved for the length */ 
        case 8 : $b+=($url[$k+7]<<24); 
        case 7 : $b+=($url[$k+6]<<16); 
        case 6 : $b+=($url[$k+5]<<8); 
        case 5 : $b+=($url[$k+4]); 
        case 4 : $a+=($url[$k+3]<<24); 
        case 3 : $a+=($url[$k+2]<<16); 
        case 2 : $a+=($url[$k+1]<<8); 
        case 1 : $a+=($url[$k+0]); 
         /* case 0: nothing left to add */ 
    } 
    $mix = mix($a,$b,$c); 
    /*-------------------------------------------- report the result */ 
    return $mix[2]; 
} 

//converts a string into an array of integers containing the numeric value of the char 
function strord($string) { 
    for($i=0;$i<strlen($string);$i++) { 
        $result[$i] = ord($string{$i}); 
    } 
    return $result; 
} 
// [url]http://www.example.com/[/url] - Checksum: 6540747202 
$url = 'info:'.$_GET['url']; 
print("url:\t{$_GET['url']}\n"); 
$ch = GoogleCH(strord($url)); 
print "<a href=\"http://www.google.com/search?client=navclient-auto&ch=";
printf("6%u",$ch); 
$pu=$_GET['url'];
print "&features=Rank&q=$url\">PR for $pu</a>";
?>
 
0
•••
nice, but use the
PHP:
 tags from VB to show the code for clarity :)

Thx
 
0
•••
Just don't get caught with it.. probably somehow against Google's TOS.
 
0
•••
The thread is a little old, but I don't see any reason why google wouldn't allow this to be freely distributed?
 
0
•••
it is using their bandwidth and their resources to help your own site
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back