Google PageRank Script
The Google PageRank is a scoring system created by Google to give websites a rank. Generally, the more popular your website is, the higher your pagerank is.
Google offers the pagerank lookup in a number of places including on their directory and on their toolbar. It wasn’t long before webmasters wanted to monitor or display their pagerank.
The idea of this is so you can display the Google pagerank of a website. This is mainly a webmaster tool, regular uses generally have little use for such information.
To begin with I found googlecommunity.com which offered an on-site pagerank lookup tool, the tool was offered as closed source and consequently created quite a presence in the industry because of this. Some time later, googlecommunity.com released the source code, which matched the source code found on the MobileRead Networks forum, which is where the original source code came from.
I used this script for quite some time, however over time I began using a combination of web servers with different operating systems and with different versions of apache and php.
I discovered that when I used this script on one server it would work fine, yet when I used it on another I discovered that google would throw me back a 403 – Forbidden error. At first, like others I believed this was due to google blocking the IP ranges of my servers therefore preventing abuse of the service.
This was wrong. I soon discovered this after checking the checksum generated by the toolbar, then the checksums generated on working servers and non-working servers.
The main issue was that my development server was running on a different platform than my production server. I discovered that the problem was down to the way the “ch” is generated by certain versions of PHP, and the way they handle bitwise operations.
The solution was to either use a perl script and pass the details back and forth via a PHP script, but this would be a very dirty way of doing what we want. The best option would be to produce a native PHP script that would function on all servers.
I tried to revive this concept in a number of places in an attempt to get a functional solution. I went back to where it began on the MobileRead Networks forum Pagerank thread. A user named “AboutSledge” offered a working solution, which was the Pagerank Checksum Caculator Source Code for Python, for C and for PHP.
This script works well, and have not experienced a problem generating a checksum. As a result of this I have created a user friendly script which uses the same algorithm which means you can display the pagerank on your site.
Update: The PageRank script has been relaunched as part of the PageRank Viewer website.
126 Responses to Google PageRank Script
← Older Comments-
Hi, I have 7 servers at HostGator, but the script dos not work on any of them !!!!
Just return a blank page…
If anyone have a solution… Thx -
I wanted the pagerank to be shown as a number, so i modified last two lines like simly like this: echo pagerank($url);
-
I have errors:
A PHP Error was encounteredSeverity: Warning
Message: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to :80 (php_network_getaddresses: getaddrinfo failed: Name or service not known)
I have save_mode = off… Can anyone help ?
-
thanks.
very nice script. -
Hey very nice script so far! Helps me very much!
I was wondering if there is a way to implement a possibility to get around the time limit. I use this function in a small pagerank bach checker and canÄt handle more than ~100 urls. I think the main reason is the time limit. I there a way to get around this? -
Very good script ! Thank you very much for sharing.
-
Very nice work with the hasing, thanks for sharing, man!
-
Hi.. Admin
your script is the best… the best … the best…. no other words… thanks for. I upload this script on site http://WWW.checkpagerank.co.nr Its working absolutely fine … but I am not a web master or I don’t know about php very well I am system administrator. so can u plz help me for making a scrip. I want users can copy result (image result url) for past on there site.
like prchecker(.)info domain. so plz help me thanks… -
Pingback: PHP PageRank Checker * Update | Ajax and PHP Web Developer Blog
-
Thank you,
it helped me a lot using that script.
Now I have to figure out the way to use it on more than 1000 urls a day.
-
Very nice work with the hosting
-
good script
-
it works like a charm. thanks for publishing the script.
-
Thank you!!!
I am happy today
-
at last ! it works ! big THX !
-
The script seems to work fine in my server. It is fast a very accurate. Thank you!
-
At last a pr checker that works!!!
Thanks a lot for your effort, after 4 years the script still works without flaws. Amazing.
-
GJ bro..Thank you..
-
thanks for sharing this script. Regards!
-
Thank for sharing the code!
-
There is this site in .ch domain which has perl program to check PR , pretty neat!
-
Just check the demo URL, Work perfectly. How to add another data like backlink ? domain fake or valid PR ? etc
-
Nice script! Change the title of the page though (“RageRank” should be “PageRank”) to increase relevancy in a search. Kind of ironic, yeah?
-Evan
Hi,
I have ported this code to python:
http://www.ikeralbeniz.net/2010/03/05/contulta-tu-pagerank-de-google-con-python/