| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | #3 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | How exactly do you put this into use?
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #4 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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).
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | #6 (permalink) |
| Senior Member Join Date: May 2003 Location: Domainut.com
Posts: 1,134
![]() ![]() | Ok even I am confused now, is this the correct code? I thought I was using the correct one on www.prlookup.com
__________________ My Expired Domains Blog ParkingIncome.com- PPC Research "Where should you park your domains?" PRLookup.com - Free Google results with PageRank |
| |
| | #8 (permalink) | ||||||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 ????: NamePros.com http://www.namepros.com/code/50698-pagerank-code-php.html
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft | ||||||||
| |
| | #10 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | So what exactly do these numbers mean?
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #11 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,123
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Imagine the SE traffic with traffic that high lol.
__________________ Reichelt Solutions |
| |
| | #13 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | And that would be?
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #14 (permalink) |
| NamePros Member Join Date: Jul 2004 Location: sweden,skane
Posts: 26
![]() | 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 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;
}
// http://www.example.com/ - 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>";
?>
__________________ will work for bandwidth |
| |
| | #17 (permalink) |
| NamePros Regular Join Date: Sep 2003
Posts: 889
![]() ![]() | The thread is a little old, but I don't see any reason why google wouldn't allow this to be freely distributed?
__________________ Online Time Tracking :) |
| |
| | #18 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Ekenas
Posts: 271
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | it is using their bandwidth and their resources to help your own site
__________________ Flexi Web Host buy Advertising On Forum Hosts Free phpBB forum hosting Free Image Host |
| |