get PR

Discussion in 'Products & Tools' started by wolandino, Aug 20, 2005.

  1. #1
    Hi, I didn`t find anuthing in search...
    I need to write script (PHP) what will getting PR... How I can do it?
     
    wolandino, Aug 20, 2005 IP
  2. eiso

    eiso Peon

    Messages:
    583
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You mean an SEO tool which will check the PR of sites?
     
    eiso, Aug 20, 2005 IP
  3. eiso

    eiso Peon

    Messages:
    583
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    eiso, Aug 20, 2005 IP
  4. Davilac

    Davilac Peon

    Messages:
    233
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Maybe this can help you:

    function getPR($_url) {
        $adress = 'info:'.$_url;
        $ch = GCH(strord($adress));
        $adress='info:'.urlencode($_url);
        $pr =
    file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$adress");
        $pr_str = implode("", $pr);
        return substr($pr_str,strrpos($pr_str, ":")+1);
    }
    
    Code (markup):
     
    Davilac, Aug 20, 2005 IP
  5. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #5
    the script is complex because it needs to compute a hash before querying google - the one I see here sounds too simple to work !
     
    picobello, Aug 29, 2005 IP
  6. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i am using davilac's code
    however I am not sure what need in my html
    here is my code: how do i link the php and the html?
    
    <?php
    function getPR($_url) {
        $adress = 'info:'.$_url;
        $ch = GCH(strord($adress));
        $adress='info:'.urlencode($_url);
        $pr =
    file("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$adress");
        $pr_str = implode("", $pr);
        return substr($pr_str,strrpos($pr_str, ":")+1);
    }
    ?>
    <html>
    <title>Google Page Rank Checker</title>
    <body>
       <form method="get">
       <table border="0">
       <tr>
         <td>
           Site URL: (example: www.google.com)
         </td>
         <td>
           <input name="url" type="text" value="<?=$address;?>">
         </td>
         <td>
           <input type="submit" value="Get PR">
         </td>
       </tr>
       </table>
       </form>
       <?=$pr_str;?>
    </body>
    </html>
    
    Code (markup):
     
    bobby9101, Dec 19, 2005 IP