Google PageRank Script
Welcome to the home of the Google PageRank script.
You’ll find all the information and code you need here:
- History of the PageRank Script by HM2K
- Find the PageRank Scripts Source Code on GitHub in various languages
- The PageRank Viewer website
- Get the Official PEAR Services PageRank package
Please feel free to leave your comments about PageRank below.
130 Responses to Google PageRank Script
← Older Comments Newer Comments →-
hello Michael !
i worked on your trick but unsucceeded.i also tried update command but fail. coz i dont know much abt mysql.
what i want to do.
i have table named : table
i have rows in it
ID : 0,1…
Title: sites title
Site: http://www.site.com, http://www.me.com….
Pr: 0What i want to do is to automatically update pr of the tables.
I want to fetch site address from Site row like > pagerank($row['Site']) and then update the Pr value from that.
How can i do that?
plz reply soon…
-
Hi Raja,
i have tried to add you to msn a while ago but to no avail, yet ?For your Problem (you might have to change this example code… but something like this should work?)
First get the Data from your mysql$sqlgetentries = mysql_query(“select ID, SITE, Pr from table);
while you have results, check the pagerank and update it if the previous saved Pr has changed:
while ($row = mysql_fetch_array($sqlgetentries)){
$getpagerank = pagerank($row[' Site']);
if ($getpagerank $row['Pr'){
mysql_query("UPDATE table SET Pr='".$getpagerank"' WHERE id='".$row["id"].”‘”)
} -
Dude thank you a TON. Your script works perfectly, and even better than the original. I’m on some fairly new version of PHP5.
-
After a week of bashing my head against a wall, I’ve finally found a working script!
-
I appreciate your efforts.
I noticed (with my script) the checksum was mangled on my production box, but under WAMP with PHP 5.x it was fine. I implemented your checksum routine and it solved the problem.
You saved me a lot of hassle and time.
If I stop by again because you’ve created something I need, I’ll look once more for a donate button
Cheers
-
Thank you very much for this. I had a script and it was not working fine on my server. Your scripts works perfectly.
-
Thanks for this script!
For right working with url with “&” symbols you need to add $url = str_replace(“&”, “%26″, $url); to the function getpr()
function getpr($url)
{
global $googlehost,$googleua;
//$url = str_replace(“%26″, “&”, $url); если передается через параметр http://pravoslavie.name/pr/pagerank.php?url=http://monar.ru/index.php?article=sitemap%26page=5
$ch = getch($url);
$url = str_replace(“&”, “%26″, $url); // add this!!!
$fp = fsockopen($googlehost, 80, $errno, $errstr, 30);
…Hello from Russia!
The Tsar’s Russia will arisen! -
Took me forever to find this, but it works like a charm. Thanks.
-
Thank you very much!
-
Thanks,man.
i use
$googlehost=’toolbarqueries.l.google.com’;ok~~it`s work well;
-
Really thanks for the script. Old one I was using from Google community was not working.
-
I’m trying to do a similar thing to Raja Amer Khan, running the function on a series of sites in a MySQL table. I’ve already got the queries set up OK (similar to what Michael suggested), but when I try to run the getpr function (because I just want the integer, and not the bar display), inside the loop generated by my select query, I get the following error message:
Warning: fsockopen() [function.fsockopen]: unable to connect to :80
If I run the script by itself with a URL in the querystring, it works OK.
Any idea what I’d need to do to get it working with my query?
(Which looks like this if that helps:
$result = mysql_query(“SELECT `site_url`, `site_id` FROM `sites` ORDER BY `site_id`”);
while ($value = mysql_fetch_array($result)) {
$rank = getpr($value['site_url']);
$id = $value['site_id'];
$result2 = mysql_query(“UPDATE `sites` SET `site_google` = ” .$rank. ” WHERE `site_id` = ” .$id);
} -
I can just imagine, that somehow the script did not get the $googlehost, since the errormessage just tells about Port 80 with nothing before it ?
Not sure but I`d check where and how the $googlehost is set and if the Funkction does actually knows it …. ? -
Pingback: The Ultimate Web Design Gallery Resource — Tyssen Design
-
very nice thanks !
-
You’re freakin genius!
Thank you and keep the good work!
-
Hello,
I try your script on my server who is hosted by OVH, but it don”t work.
On a local server, i get the good page rank.
You can see the result at
http://www.webmestre-annuaire.com/pagerank/mypagerank.php
Thanks for your answer. -
Thank you!!! It’s working on my servers …
-
Thank a lot!!!
-
Pingback: Twitter Tweets about PageRank as of July 23, 2008 : The Lessnau Lounge
-
it seems a good script, I’m looking for one that allow webmasters to grab a html code and paste on their webpages to show pagerank
it would be a fantastic source of (almost) free linkscheck stats21.com seo stats tool to make u an idea of what I’m talking about
is this script useful for me?
-
Not too bad. I hacked up a utility that will get the PR for thousands of domains in one quick easy pass…
-
This scrip support SOCKs proxies?
Regards.
-
Man, thanks !
Its what i searched for.You are great one.
-
awesome!
was a few days looking for a real one.
keep it up!
-
Any ideas how to get around this problem?
We’re sorry…
… but your query looks similar to automated requests from a computer virus or spyware application. To protect our users, we can’t process your request right now.
We’ll restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected, you might want to run a virus checker or spyware remover to make sure that your systems are free of viruses and other spurious software.
We apologize for the inconvenience, and hope we’ll see you again on Google.
-
@Scott:
You can generate this type of error by making searches as fast as possible (5-10/sec). At one point google will think you’re a bot, hence the “your query looks similar to automated requests from a computer virus or spyware application”.So you might want to reduce the speed and/or the amount of request to google.
I have now made it so, that i request a Pagerank for a site when i add it, put the PR-Value into a mysql-Database and also save the Date of the request.
While displaying the pagerank i check the date and if it is x days old (lets say 30 or maybe 90 days) i let it update and save the (maybe) new pagerank and new date.
Otherwise i just display the pagerank it has already got.For me this has 4 good sides:
1: I wont mass-request google
2: the display of many pageranks per Site is much faster
3: more accurate when googles server isnt responding
4: I can check, what pageranks i have grouped by its value (e.g. 3523 x PR 3)Updates will mostly done by visitors of my sites, so it keeps itself updated for frequently visited entries.
The bad side might be, that when google does updates while the date isnt too old, it will show the old, outdated pagerank…. and of course a higher amount of Database-request (might wanna add some caching some day … but its running fine right now, so why not beeing lazy? *grin*) -
Addtition:
I also check how many entries i have and check against how many pageranks i have saved.
So i can be pretty sure, if all sites are checked.Since i actually have 13089 (and counting ^^) entries i cant really check and keep them updated manually.
-
Thanks HM2k, I found a few PHP pagerank scripts on the web but yours seems the best.
-
is there any way to tell whether PR is 0 or there was some error? I’m writing results to the DB and would really like to know…
-
Thanx a lot pal, it works like a charm
-
@ Mateusz Mucha:
Check out Function getpr and have a look a:
if($pos === false){//you could add something maybe to $pr here ^^ } -
thanks Pal
Keep up the good work.
-
hello.
I’m Japanese.
I had been looking for this script for a long term.
It is very glad to me.
thanks!!!the script moved when changing as follows.
##
hammer said,
You need to make a change at the bottom of the page in the last 2 lines
take away the // symbols in front of the line that has them at the beginning, save it, then retest it
##Thank you for everybody.
-
hi ,
I use this script in my website and upload it on my server, it work well when i used it on the local server , but when i uplaod it to the main server it show the blank page …………….
plz help me out from this problem , suggest me what to do…………. -
hi.
it is very nice script for me.
thank you very much.
-
awesome!
was a few days looking for a real one.
keep it up!
-
Great!!! Works!!!
Actually I tested it in local. As soon as possible I will put it on my online web server. I hope that the script will work online too. A lot of web servers are incompatible with this kind of scripts. I come back to write if works when I finish.
Sorry for my poor English… -
Great Work, Thank you very much for sharing.
-
Am I missing something? Where do I download the code for this?
-
I’ve just tried the script and it gives me a 403 Forbidden error. Isn’t this script supposed to “fix” the 403 error?
-
Thanks…
I’m using PHP version 4.4.9
Can you tell me if this should be sufficient or what version I would need?
Thanks
-
Cheers – have just switched server to 5 (my provider sets 4 as default for some reason). Script now working perfectly.
Many thanks for the script and your help.
The page rank script is giving me a 404 error they just did a google page rank update a few hours ago and ever since they did the update my script ain’t working I get a 404 back?