Results 1 to 4 of 4

Thread: PHP: Multiple URL Pagerank Checker

  1. #1
    chetan's Avatar
    chetan is offline PHP Coder
    Join Date
    Mar 2009
    Location
    India , Nagpur
    Posts
    74
    Thanks
    3
    Thanked 6 Times in 5 Posts

    PHP: Multiple URL Pagerank Checker

    Here is my Code

    PHP Code:
    <?php
    function StrToNum($Str$Check$Magic)
    {
        
    $Int32Unit 4294967296;  // 2^32

        
    $length strlen($Str);
        for (
    $i 0$i $length$i++) {
            
    $Check *= $Magic;     
            if (
    $Check >= $Int32Unit) {
                
    $Check = ($Check $Int32Unit * (int) ($Check $Int32Unit));
               
                
    $Check = ($Check < -2147483648) ? ($Check $Int32Unit) : $Check;
            }
            
    $Check += ord($Str{$i}); 
        }
        return 
    $Check;
    }
    function 
    CheckHash($Hashnum)
    {
        
    $CheckByte 0;
        
    $Flag 0;

        
    $HashStr sprintf('%u'$Hashnum) ;
        
    $length strlen($HashStr);
        
        for (
    $i $length 1;  $i >= 0;  $i --) {
            
    $Re $HashStr{$i};
            if (
    === ($Flag 2)) {              
                
    $Re += $Re;     
                
    $Re = (int)($Re 10) + ($Re 10);
            }
            
    $CheckByte += $Re;
            
    $Flag ++;    
        }

        
    $CheckByte %= 10;
        if (
    !== $CheckByte) {
            
    $CheckByte 10 $CheckByte;
            if (
    === ($Flag 2) ) {
                if (
    === ($CheckByte 2)) {
                    
    $CheckByte += 9;
                }
                
    $CheckByte >>= 1;
            }
        }

        return 
    '7'.$CheckByte.$HashStr;
    }
    function 
    HashURL($String)
    {
        
    $Check1 StrToNum($String0x15050x21);
        
    $Check2 StrToNum($String00x1003F);

        
    $Check1 >>= 2;     
        
    $Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 0x3F);
        
    $Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 0x3FF);
        
    $Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 0x3FFF);    
        
        
    $T1 = (((($Check1 0x3C0) << 4) | ($Check1 0x3C)) <<) | ($Check2 0xF0F );
        
    $T2 = (((($Check1 0xFFFFC000) << 4) | ($Check1 0x3C00)) << 0xA) | ($Check2 0xF0F0000 );
        
        return (
    $T1 $T2);
    }
    function 
    getpagerank($url) {
        
    $query="http://toolbarqueries.google.com/search?client=navclient-auto&ch=".CheckHash(HashURL($url)). "&features=Rank&q=info:".$url."&num=100&filter=0";
        
    $data=file_get_contents($query);
        
    $pos strpos($data"Rank_");
        if(
    $pos === false){} else{
            
    $pagerank substr($data$pos 9);
            return 
    $pagerank;
        }
        
        
    }
    if(
    $_POST['urls'])
    {
        
    ?><table border="1">
        <th>URL</th>
        <th>Pagerank</th>
        <?
        $urls
    =trim($_POST['urls']);
        
    $url=explode("\n",$urls);
        foreach(
    $url as $url)
        {
            if(
    $url)
            {
                
    $url=trim($url);
                
    $pagerank=getpagerank($url);
                
    ?>
                <tr><td><?php echo $url?></td><td><?php echo $pagerank?></td></tr>
                <?        
                flush
    ();
            }                
        }
        
    ?></table><?
    }
    else
    {
        
    ?><form action="" method="post">
        URLS:-<br /><textarea name="urls" cols="50" rows="10">http://www.google.com
    http://www.yahootracer.com</textarea><br /><input type="submit" value="Check PR"/>
        </form>
        <?
    }
    ?><br /><br /><br />[xtrmcoder@gmail.com]
    I love to share my codes

    P.S:- File_get_funtion should be enabled else replace it with curl
    Visit : Paste-Bin | Yahoo Tracer | Twitter Signatures
    Contact Me For PHP Works
    An cURL Expertise

  2. Thanked by:

    Aziz (26 September, 2009), Keldorn (26 September, 2009)

  3. #2
    Keldorn's Avatar
    Keldorn is offline Net Builder
    Join Date
    Dec 2008
    Location
    Canada
    Posts
    400
    Thanks
    21
    Thanked 60 Times in 52 Posts
    Thats really awesome Chetan. I think I could use something like that. Too often the sites like PRchecker.info dont work. So what is the hashURL(); do? I'm guessing its some kind of security mechanism that you weren't supposed to figure out? oops.
    Submit new proxies -

  4. #3
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    Hey do you run Web Diagnostic ?

    Because these functions are from the script they wrote a while ago : PHP script - google page rank - Web Diagnostic

    I don't mean to insinuate anything, I'm just curious.

  5. #4
    chetan's Avatar
    chetan is offline PHP Coder
    Join Date
    Mar 2009
    Location
    India , Nagpur
    Posts
    74
    Thanks
    3
    Thanked 6 Times in 5 Posts
    Quote Originally Posted by dtkguy View Post
    Hey do you run Web Diagnostic ?

    Because these functions are from the script they wrote a while ago : PHP script - google page rank - Web Diagnostic

    I don't mean to insinuate anything, I'm just curious.
    How I made this script , recipe


    One guy requested this multiple url pr checker in DP ,Dam From were to check pr .I was confused.Than I saw in my firefox , In toolbar there is pr checker .It must be fetching pr from any url.So Using HTTP Headers Add-on I found this url for checking pr.But dam again , the url was encoded in some hash code and was not knowing to encode such text.So i Google And came to Web Diagnostic , I copied hash functions from it and you may notice other part is genuine made by me
    Visit : Paste-Bin | Yahoo Tracer | Twitter Signatures
    Contact Me For PHP Works
    An cURL Expertise

Similar Threads

  1. Which Backlink Checker you use ?
    By Digital in forum Stats
    Replies: 20
    Last Post: 27 June, 2013, 03:17 AM
  2. Replies: 0
    Last Post: 20 February, 2010, 06:15 AM
  3. What's the difference between Backlink Checker & Reciprocal Link Checker?
    By YaroslavKorchagin in forum Reciprocal Link Checker
    Replies: 2
    Last Post: 4 February, 2010, 16:03 PM
  4. Which Link Checker Do You Use?
    By Farrhad A in forum Stats
    Replies: 5
    Last Post: 20 May, 2009, 00:54 AM
  5. Backlink Checker?
    By lethalboom in forum Stats
    Replies: 4
    Last Post: 12 May, 2009, 17:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •