NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page PageRank Code php

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.

Advanced Search
7 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 10-07-2004, 10:54 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Scorpio's Avatar
Join Date: Jun 2004
Posts: 967
Scorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud ofScorpio has much to be proud of
 


Save The Children Save The Children Save The Children Save The Children Save The Children Save The Children Save The Children Save The Children

PageRank Code php


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

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

Attached Files
File Type: txt google.txt (2.8 KB, 171 views)
Scorpio is offline  
Old 10-11-2004, 01:11 PM   #2 (permalink)
NamePros Regular
Join Date: Oct 2004
Location: Toronto, Canada
Posts: 755
Jokez Guy is just really niceJokez Guy is just really niceJokez Guy is just really niceJokez Guy is just really nice
 




Thxs for this file, i will thank you more, if you tell me what this does -_-?
Jokez Guy is offline  
Old 10-11-2004, 01:17 PM   #3 (permalink)
Senior Member
 
Crusader's Avatar
Join Date: Aug 2003
Location: Canada
Posts: 1,257
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
 



How exactly do you put this into use?
Crusader is offline  
Old 10-12-2004, 09:45 AM   #4 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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
Peter is offline  
Old 10-12-2004, 12:42 PM   #5 (permalink)
NamePros Regular
 
Nunim's Avatar
Join Date: Oct 2004
Location: Florida
Posts: 384
Nunim is an unknown quantity at this point
 



Hmm displays something like this:

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

I hope not cause that is just terrible...
Last edited by Nunim; 10-12-2004 at 01:07 PM.
Nunim is offline  
Old 10-12-2004, 02:05 PM   #6 (permalink)
Senior Member
 
Domainut's Avatar
Join Date: May 2003
Location: Domainut.com
Posts: 1,134
Domainut has a spectacular aura aboutDomainut has a spectacular aura about
 



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
Domainut is offline  
Old 10-12-2004, 02:09 PM   #7 (permalink)
NamePros Regular
 
Nunim's Avatar
Join Date: Oct 2004
Location: Florida
Posts: 384
Nunim is an unknown quantity at this point
 



GoolePR.com give me a 3 and this thingy says 6656508260
Nunim is offline  
Old 10-12-2004, 02:51 PM   #8 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by Domainut
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
????: NamePros.com http://www.namepros.com/code/50698-pagerank-code-php.html


Quote:
GoolePR.com give me a 3 and this thingy says 6656508260
the googlepr 1 is obviously the correct 1.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 10-12-2004, 02:52 PM   #9 (permalink)
aww
Senior Member
 
aww's Avatar
Join Date: Jan 2004
Posts: 1,187
aww is a jewel in the roughaww is a jewel in the roughaww is a jewel in the rough
 



This will work until Google changes the checksum algorithm which is likely given the spread of such code now.
aww is offline  
Old 10-12-2004, 04:59 PM   #10 (permalink)
Senior Member
 
Crusader's Avatar
Join Date: Aug 2003
Location: Canada
Posts: 1,257
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
 



So what exactly do these numbers mean?
Crusader is offline  
Old 10-12-2004, 05:09 PM   #11 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,123
Darkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to beholdDarkfire001 is a splendid one to behold
 



Imagine the SE traffic with traffic that high lol.
__________________
Reichelt Solutions
Darkfire001 is offline  
Old 10-13-2004, 06:04 AM   #12 (permalink)
NamePros Regular
Join Date: Jun 2003
Location: .au/.sg
Posts: 221
alien is on a distinguished road
 



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.
__________________
@

PageRank.net - Search Engine Optimization
alien is offline  
Old 10-13-2004, 09:56 AM   #13 (permalink)
Senior Member
 
Crusader's Avatar
Join Date: Aug 2003
Location: Canada
Posts: 1,257
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
 



And that would be?
Crusader is offline  
Old 10-28-2004, 06:30 PM   #14 (permalink)
NamePros Member
Join Date: Jul 2004
Location: sweden,skane
Posts: 26
hartman is an unknown quantity at this point
 



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; 
} 
// 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
hartman is offline  
Old 10-28-2004, 06:46 PM   #15 (permalink)
Senior Member
 
PolurNET's Avatar
Join Date: Jul 2004
Location: I ♥ Business Law
Posts: 3,082
PolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant futurePolurNET has a brilliant future
 

Member of the Month
January 2007
Alzheimer's Cancer Survivorship Third World Education Autism Save a Life Cystic Fibrosis Parkinson's Disease Lou Gehrig's Disease (ALS) Autism Multiple Sclerosis SIDS
nice, but use the [php] tags from VB to show the code for clarity

Thx
PolurNET is offline  
Old 12-12-2004, 03:23 AM   #16 (permalink)
NamePros Member
 
yz0rx's Avatar
Join Date: Oct 2004
Posts: 97
yz0rx is an unknown quantity at this point
 



Just don't get caught with it.. probably somehow against Google's TOS.
yz0rx is offline  
Old 12-12-2004, 05:31 AM   #17 (permalink)
NamePros Regular
 
CreativeLogic's Avatar
Join Date: Sep 2003
Posts: 889
CreativeLogic has a spectacular aura aboutCreativeLogic has a spectacular aura about
 



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 :)
CreativeLogic is offline  
Old 12-15-2004, 11:33 PM   #18 (permalink)
NamePros Regular
 
flexiwebhost.com's Avatar
Join Date: Jun 2004
Location: Ekenas
Posts: 271
flexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to beholdflexiwebhost.com is a splendid one to behold
 



it is using their bandwidth and their resources to help your own site
flexiwebhost.com is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 07:25 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger