2ge has asked for the wisdom of the Perl Monks concerning the following question:

Hi all nice monks! I don't know if somebody is concerned about SEO, but google pagerank algorhytm was found. I search web for PERL source code, but I can't find it, so maybe one from you will be first who write this in perl. Here is link to PHP sourcecode: PHP LINK

Replies are listed 'Best First'.
Re: OT: Google PR, PHP -> PERL ?
by tachyon (Chancellor) on Aug 19, 2004 at 00:30 UTC

    This has nothing to do with Google's page rank algorithm, if just allows you to access the Google page rank info as described here This is actually just a PHP implementation of Bob Jenkins' 32 bit integer hashing algorithm. I wrote a Perl XS module implementing this algorithm a couple of years ago and it has been on CPAN since 2003 - Digest::JHash. You will need to change the line c=0 in JHash.xs to c=0xe6359a60 before you compile it to get the Google init constant right. Then you can just:

    use Digest::JHash 'jhash'; print 'Checksum: 6' . jhash('info:http://www.google.com/'); __DATA__ Checksum: 64222138902

    to get the correct checksums. I might point out that this is against the Google TOS (well if you get the checksum wrong that is where they refer you).

    Google's pagerank algorithm is a complex beast. You can read about the original implementation in the original paper from Brin and Page at The Anatomy of a Large-Scale Hypertextural Search Engine

    Here is the XS code as a standalone Inline C widget:

      Hello Tachyon!

      Thank you very much for helping, ofcourse everything works, when I install my new linux. Working under win system is really terrible, I can't even install Jhash properly. Good job, thanks again!