The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > PHP


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags: , , , , , ,

Reply
 
LinkBack (3) Thread Tools    Display Modes   
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-14-2007, 10:42 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Icon11 Google PageRank Checksum Calculator

I haven't tried this code yet, but yet I think is interesting and pretty useful for programmers. So I guess I should post it here, I found it from somewhere else, but they say that it's an open source... enjoy and hopefully it's helpful...

PHP 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 
$c+=($url[$k+8]<<8);  
          
/* the first byte of c is reserved for the length */  
        
case $b+=($url[$k+7]<<24);  
        case 
$b+=($url[$k+6]<<16);  
        case 
$b+=($url[$k+5]<<8);  
        case 
$b+=($url[$k+4]);  
        case 
$a+=($url[$k+3]<<24);  
        case 
$a+=($url[$k+2]<<16);  
        case 
$a+=($url[$k+1]<<8);  
        case 
$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;  
}  
// [url=http://www.example.com/]Example Web Page[/url] - Checksum: 6540747202  
$url 'info:'.$_GET['url'];  
print(
"url:\t{$_GET['url']}\n");  
$ch GoogleCH(strord($url));  
printf("ch:\t6%u\n",$ch);  
?>
The code will basically check the PageRank of a website

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #2 (permalink)  
Old 07-15-2007, 04:36 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 615
iTrader: (0)
Lee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enough
And if you dont understand how to use that theres always the easy way out, get the google toolbar, go to the page you want to see the rank of and there you go its shown in your google toolbar

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #3 (permalink)  
Old 07-18-2007, 11:19 PM
chrishirst chrishirst is offline
Jr. Programmer
Join Date: Jun 2007
Location: Blackpool UK
Posts: 87
iTrader: (0)
chrishirst will become famous soon enoughchrishirst will become famous soon enough
Quote:
The code will basically check the PageRank of a website
Websites don't have PageRank.

PageRank is assigned to individual webpages or more correctly to distinct and individual URIs.
A trifling but important distinction.

Now if there was some way of reading the REAL PR of a page, that would be interesting.

__________________
Chris
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #4 (permalink)  
Old 07-19-2007, 10:03 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
Programming Expert
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,109
iTrader: (0)
HelloWorld will become famous soon enoughHelloWorld will become famous soon enoughHelloWorld will become famous soon enough
Quote:
Now if there was some way of reading the REAL PR of a page, that would be interesting.
what do you mean by REAL PR ???
Are you talking about the PR that Google gave, or our own rated PR based on the quality of the site..? but based on what?

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #5 (permalink)  
Old 07-19-2007, 10:19 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 615
iTrader: (0)
Lee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enough
Quote:
Originally Posted by HelloWorld View Post
what do you mean by REAL PR ???
Are you talking about the PR that Google gave, or our own rated PR based on the quality of the site..? but based on what?
Think he means PR from everything, all the net, papers, tv, member base etc etc, googles as far as i know is based on some net things but thats about it.
Reply With Quote
  #6 (permalink)  
Old 07-20-2007, 08:07 AM
chrishirst chrishirst is offline
Jr. Programmer
Join Date: Jun 2007
Location: Blackpool UK
Posts: 87
iTrader: (0)
chrishirst will become famous soon enoughchrishirst will become famous soon enough
Nope

real PR is the actual value of PageRank that Google uses as one small part of the ranking algo.

The useless, out of date, inaccurate green bar that everyone is obsessed with isn't anything to do with what the real value is

__________________
Chris
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #7 (permalink)  
Old 07-20-2007, 08:24 PM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 308
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
remember, not all pagerank datacenters are the same - you need to hitmuliple datacenters (google pr server ips) for a correct pr
Reply With Quote
Reply


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.programmerstalk.net/thread911.html
Posted By For Type Date
How to test for Google PageRank This thread Refback 08-03-2007 04:17 AM
How to test for Google PageRank This thread Refback 07-26-2007 11:27 AM
How to test for Google PageRank This thread Refback 07-25-2007 08:20 PM


All times are GMT -7. The time now is 05:03 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50