View Full Version : Google Page Rank checker code inside (open source) - Question
Torrentguy
Feb 27th 2006, 9:37 pm
<?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;
}
// http://www.example.com/ - Checksum: 6540747202
$url = 'info:'.$_GET['url'];
print("url:\t{$_GET['url']}\n");
$ch = GoogleCH(strord($url));
printf("ch:\t6%u\n",$ch);
?>
Just curious as to if anyone else uses this code in their sites, such as iwebtool and others. I was thinking of putting it to use, I see a few people selling sites here that utilize this code, even some selling the code.. maybe some feedback on this would be nice...
Thanks in advance.
Torrentguy
Feb 27th 2006, 10:20 pm
http://www.everyscript.de/PRank.htm
there is also the source of the up to date code for perl
it is a free code, just looking for feedback on it...
rehash
Mar 1st 2006, 2:51 am
I dont think google agrees with these tools, if they would, then it would have been much simplier, but the way there are, it's pretty obvious someone did reverse engineering on the toolbar which is pretty much illegal
mad4
Mar 1st 2006, 4:00 am
As far as I know this is the only way to get the PR of a page from google.
Also pretty sure that this is how the keyword tracker tool must work (as there isn't really another way).
miles
Mar 1st 2006, 4:05 am
Also pretty sure that this is how the keyword tracker tool must work (as there isn't really another way).
Sorry, which keyword tool are you talking about? The one here at DP?
This code is confusing...Could the thread starter provide some reference to its origin or a URL duscussing it further?
mad4
Mar 1st 2006, 4:10 am
Sorry, which keyword tool are you talking about? The one here at DP?
Yes, and probably any other scripts that do the same.
If google wanted to stop this script working they could quite easily. Or they could make it part of the API.
I was reading this post (http://www.jimwestergren.com/google-rk-as-internal-live-pagerank-pr-evidence-findings/) about an RK value being passed in the google results XML feed which may be the actual up to date PageRank.
mdvaldosta
Mar 1st 2006, 4:19 am
I think the latest PR flux has disproved the theory that RK means current pagerank.
toby
Mar 1st 2006, 4:22 am
Isn't that those scripts illegal? Is it okay with Google?
mdvaldosta
Mar 1st 2006, 5:14 am
Isn't that those scripts illegal? Is it okay with Google?
Your not supposed to pull PR without using the API. Any server that runs PR checking code without using the API runs the risk of having that server (IP) blocked from requesting PR in the future. It happens on occasion with those running directory scripts that check PR as well as some SEO software.
mad4
Mar 1st 2006, 7:56 am
Your not supposed to pull PR without using the API.
But is there a way to get PR using the API?
mdvaldosta
Mar 1st 2006, 7:58 am
Yea the directory scripts, like phpld, do it.
mad4
Mar 1st 2006, 8:15 am
Quote from David (http://www.phplinkdirectory.com/forum/viewtopic.php?p=9942&sid=5a3de05e1e8460092f63234686920d7c) the owner of phpld on his forum a few weeks ago.
Google API does not give pagerank, and Google forbids automated queries to their server. So that is why it is best not to do it from your webserver, especially automated queries that check pagerank for multiple sites at once.
It looks like phpld uses the script discussed above. dvduval is the owner and is on this forum I think.........
miles
Mar 1st 2006, 3:46 pm
It happens on occasion with those running directory scripts that check PR as well as some SEO software.
Do you remember where you saw an example of a site deploying a PR checking tool, or even a mass data center PR checking tool, and then getting banned? Everyone is runnng it. Seochat for one.
If google wanted to stop this script working they could quite easily.
How do you figure? I mean there are a million sites running this toolbar hacked code and not a lot G can do about it from where Im standing. My guess is it will be imbedded in the API very soon as you point out - In fact I would be very surprised if it isn't this RK value after all.
wannaknow
May 18th 2006, 7:12 am
Can anyone please give a link to future pagerank/pagerank prediction php script ? I mean the actual source code, not a site providing such a service.
ThomasSchulz
May 30th 2006, 1:07 pm
Check the first post in this thread...? The code is in an iframe.
mirainfo
May 30th 2006, 8:00 pm
Hey Guys, Is it bad to query google for this? I thought this is not illigal.
wannaknow
May 30th 2006, 10:49 pm
Check the first post in this thread...? The code is in an iframe.
I was asking for PR prediction script, not current PR detection.
Also, if anyone has php scripts of backlinks/alexa checking, etc - i will greatly appreciate that.
mad4
May 31st 2006, 1:41 am
You can't predict pagerank, there are no reliable scripts to do this.
desyman
Jun 3rd 2006, 8:22 am
did anyone tracnscript it to jsp yet ?
was looking for it for a few weeks, but no success.
php is good, but need it in jsp.
can do it on my own, but need extra couple hours, which i have not
enampwd
Jun 24th 2006, 7:37 am
I am using a php script which is similar to the above script. I have collected it from internet. But I forgot from where.
georgiecasey
Jul 1st 2006, 3:16 pm
did anyone tracnscript it to jsp yet ?
was looking for it for a few weeks, but no success.
php is good, but need it in jsp.
can do it on my own, but need extra couple hours, which i have not
you cant expect people to do work for you! i know of no jsp version
MadroosterTony
Jul 3rd 2006, 11:00 pm
becaure of your server php config, it will not always return the correct page rank, based on some of the php modules installed or not installed.
BIGC
Jul 3rd 2006, 11:05 pm
ya its a good script ...
vic_msn
Jul 4th 2006, 5:16 am
this script is used in phplinkdirectory to check PR
georgiecasey
Jul 11th 2006, 10:54 am
Does this still work?? I keep 404 forbidden messages
xeno
Jul 11th 2006, 12:46 pm
[PHP]
Just curious as to if anyone else uses this code in their sites, such as iwebtool and others. I was thinking of putting it to use, I see a few people selling sites here that utilize this code, even some selling the code.. maybe some feedback on this would be nice...
Thanks in advance.
I use something similar, but I have it inside a Flash movie so that it doesn't bring you to a new page, it just posts the rank in the movie very quickly.
born2win
Jul 14th 2006, 5:00 am
Does this still work?? I keep 404 forbidden messages
This one still works without any problem. Check whether your webhosting service supports CURL. I tried to run in the server which dont have CURL compiled PHP version and I got all PR as 1. Then I tried in the server having CURL installed and got the correct PR. you check in this area. Good luck :).
amirlol
Jul 24th 2006, 6:39 am
hi dear;
please join asp google rank
thanks
amirlol@gmail.com
grobar
Aug 7th 2006, 6:03 pm
hi dear;
please join asp google rank
thanks
amirlol@gmail.com
What is that??
MaxPowers
Aug 13th 2006, 1:28 pm
I have been using this PR script for well over a year on various sites. For one, I cache requests for the same URL for 24 hours to reduce the load of queries to Google.
now I want to check PR on 20,000+ domains per day...
Is there a legitimate way?
The demand for PR on webpages is higher than ever and being incorporated into many diverse apps. Perhaps Goog ought to consider de-centralizing the listings to reduce performance hits on their main server... or offer a dump like odp does...
Reduces their brunt of the load and satisfies the appetites of hungry developers.
master06
Nov 16th 2006, 12:59 am
i changed my server. New server cpu 64 bit so i have got some code problems. i need this script 64bit vers.
Regards,
Mustafa
srucnoc
Nov 17th 2006, 3:31 am
Does anyone have a srcipt that checks PR using an API? I'd like to see how that code works
mad4
Nov 17th 2006, 3:32 am
You can't check PR using the Google API. The only way is the code at the start of this thread.
azizny
Nov 18th 2006, 7:09 am
Just incase no one noticed, this script doesn't work nor reflect Google's actual PG.
I tried it couple of months ago, for example try some links with the site TorrentGuy posted:
http://www.everyscript.de/PRank.htm
and you will see my point, his page is pageranked 4, but the script returns 0!
Peace,
master06
Nov 18th 2006, 1:17 pm
ok i find 64 bit edition version and i develop it. now works great.
Ali_GGL
Jan 27th 2008, 11:59 pm
Hi Torrentguy
i have used your code to utilize it for my website and i when entered a url to it its giving me a ch: 6537457445 number i think it is not page rank or may be i am not utilizing it right so please guide me how to utilize this code for my website.
Thanks.
Ali.
smartneil
Jan 29th 2008, 9:22 pm
thanks i will try this code ay my site
ravi72194
Jan 30th 2008, 7:06 am
code is not working..
softgroups
Mar 4th 2008, 2:30 am
code is not working..
yes you are very right...
cchetanonline
Mar 4th 2008, 2:39 am
i need such script
can any one please tell me from where i will get this type of script for free
i think the current which is given heere is not working
00johnny
Mar 10th 2008, 12:41 am
Guys the script is 2 years old just like this thread, i'm sure its obsolete by now
Bryce
Mar 11th 2008, 4:02 pm
The one here...
http://v1.magicbeandip.com/mbd-file/PageRankReport.php
works fine. The only problem is no PR checker works absolutely correct during updates.
If anybody is interested in purchasing a javascript version, PM me....
chandan123
Mar 17th 2008, 4:31 am
great it gives for
digitalpoint.com -1
yahoo.com -1 :eek: so u want us to purchase this :D
richard.feakes
Mar 17th 2008, 8:30 am
www.pagerankreporter.com (http://www.pagerankreporter.com)
This website uses a similar script, I think.
Findfair
Mar 17th 2008, 11:06 pm
totally Puzzled
qxiu
Apr 23rd 2008, 1:57 am
who has asp code get PR?thanks
Mulith
Feb 21st 2009, 9:45 am
Does anyoe know of a mass PR checker? Where you can enter multiple domains and get an output of their PR.
kmr909
Apr 18th 2009, 4:10 pm
am interested to create a search engine like google is it able to create a like google with the help of this php code or not
mr_vampire
May 2nd 2009, 3:42 am
This may work ..
http://rapidshare.com/files/215528888/pagerank_script.rar
superds
Jun 2nd 2009, 9:49 am
This script hits the url that Google Toolbar is using. Google will not track that request is generate either from Toolbar or via website. But it against Google terms and conditions.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.