A page rank button for a remote site...is it possible?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jace
    FBOP Class Of 2013
    • Jan 2004
    • 35562

    #1

    A page rank button for a remote site...is it possible?

    I am making a web page with a list of sites on it, and I wanna display a pagerank button to show the PR of each site, but all the buttons I found are so you can display the PR of the local site, not remote sites, like this


    is there any way to show the pagerank of other sites in a button like that?
  • Damian_Maxcash
    So Fucking Banned
    • Oct 2002
    • 12745

    #2
    There is - I have done it - but I will have to dig around my bookmarks....

    I could be some time

    Comment

    • Jace
      FBOP Class Of 2013
      • Jan 2004
      • 35562

      #3
      Originally posted by damian2001
      There is - I have done it - but I will have to dig around my bookmarks....

      I could be some time
      i can wait, LOL...I have been searching google for an hour

      even if I have to host it myself, i don't care

      Comment

      • emthree
        Dialer Kingpin
        • Jun 2003
        • 10816

        #4
        Not sure if there's any public open-script ones.
        But i'm sure you can get a coder to hack it up real quick for you.

        • Sell Patches & Pills •

        Comment

        • squishypimp
          PostMaster General
          • Aug 2006
          • 10781

          #5
          jace, check out axslinks (axscripts.com), they have found a way to poll PR of URLs through their client side script.

          Comment

          • Bama
            Confirmed User
            • Nov 2001
            • 2727

            #6
            I offer this service on xxxwebmasters.com

            Go grab one

            Comment

            • Jace
              FBOP Class Of 2013
              • Jan 2004
              • 35562

              #7
              Originally posted by squishypimp
              jace, check out axslinks (axscripts.com), they have found a way to poll PR of URLs through their client side script.
              please show me on that site where they have a pr button I can put on my site that will display the PR of a remote site

              Comment

              • Jace
                FBOP Class Of 2013
                • Jan 2004
                • 35562

                #8
                Originally posted by Bama
                I offer this service on xxxwebmasters.com

                Go grab one
                I don't see a button that allows me to show another url's PR

                Comment

                • Jace
                  FBOP Class Of 2013
                  • Jan 2004
                  • 35562

                  #9
                  I found one you all

                  http://www.pageranker.org/

                  Comment

                  • Tempest
                    Too lazy to set a custom title
                    • May 2004
                    • 10217

                    #10
                    You need to consider that your page loads are going to be painfully slow if you have the script request the PR for every site in your list... What you really want is a script that runs maybe once a day on your server and it grabs the pr of all the sites.. that script could generate a little graphic for you or something which you would then include on the page.

                    Comment

                    • squishypimp
                      PostMaster General
                      • Aug 2006
                      • 10781

                      #11
                      Originally posted by Jace
                      please show me on that site where they have a pr button I can put on my site that will display the PR of a remote site
                      its a line of code that can grab PR and display it. if you want to format it into a button that can be done too.

                      i am running through the source now to find the line of code you need

                      Comment

                      • Jace
                        FBOP Class Of 2013
                        • Jan 2004
                        • 35562

                        #12
                        Originally posted by Tempest
                        You need to consider that your page loads are going to be painfully slow if you have the script request the PR for every site in your list... What you really want is a script that runs maybe once a day on your server and it grabs the pr of all the sites.. that script could generate a little graphic for you or something which you would then include on the page.
                        it is a page only I, and a few others, will be using

                        Comment

                        • borked
                          Totally Borked
                          • Feb 2005
                          • 6284

                          #13
                          A php function for ya:

                          Code:
                          header("Content-Type: text/plain; charset=utf-8"); 
                          
                          define('GOOGLE_MAGIC', 0xE6359A60); 
                          
                          
                          //unsigned shift right 
                          
                          function zeroFill($a, $b) 
                          
                          { 
                              $z = hexdec(80000000);
                              //echo $z;
                          
                                  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); 
                          
                              //echo $mix[0];
                          
                              /*-------------------------------------------- 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 = $_GET['url']; 
                          //print("url:\t{$_GET['url']}\n"); 
                          
                          $ch = "6" . GoogleCH(strord("info:" . $url)); 
                          
                          
                          $fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
                          if (!$fp) {
                             echo "$errstr ($errno)<br />\n";
                          } else {
                             $out = "GET /search?client=navclient-auto&ch=". $ch .  "&features=Rank&q=info:" . $url . " HTTP/1.1\r\n";
                             $out .= "Host: www.google.com\r\n";
                             $out .= "Connection: Close\r\n\r\n";
                          
                             fwrite($fp, $out);
                             
                             //$pagerank = substr(fgets($fp, 128), 4);
                             //echo $pagerank;
                             while (!feof($fp)) {
                          	$data = fgets($fp, 128);
                          	$pos = strpos($data, "Rank_");
                          	if($pos === false){} else{
                          		$pagerank = substr($data, $pos + 9);
                          		echo $pagerank;
                          	}
                             }
                             fclose($fp);
                          }

                          For coding work - hit me up on andy // borkedcoder // com
                          (consider figuring out the email as test #1)



                          All models are wrong, but some are useful. George E.P. Box. p202

                          Comment

                          • Jace
                            FBOP Class Of 2013
                            • Jan 2004
                            • 35562

                            #14
                            squishypimp
                            This message is hidden because squishypimp is on your ignore list.

                            Comment

                            • squishypimp
                              PostMaster General
                              • Aug 2006
                              • 10781

                              #15
                              Code:
                              <?php 
                              /* 
                                      Written and contributed by 
                                      Alex Stapleton, 
                                      Andy Doctorow, 
                                      Tarakan, 
                                      Bill Zeller, 
                                      Vijay "Cyberax" Bhatter 
                                      traB 
                                  This code is released into the public domain 
                              */ 
                              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; 
                              } 
                              
                              
                              // converts an array of 32 bit integers into an array with 8 bit values. Equivalent to (BYTE *)arr32 
                              
                              function c32to8bit($arr32) { 
                                  for($i=0;$i<count($arr32);$i++) { 
                                      for ($bitOrder=$i*4;$bitOrder<=$i*4+3;$bitOrder++) { 
                                          $arr8[$bitOrder]=$arr32[$i]&255; 
                                          $arr32[$i]=zeroFill($arr32[$i], 8); 
                                      }     
                                  } 
                                  return $arr8; 
                              } 
                              
                              function GoogleCHNew($ch){
                              	$ch=sprintf("%u", $ch); 
                              	$ch = ((($ch/7) << 2) | (((int)fmod($ch,13))&7)); 
                              	$prbuf = array(); 
                              	$prbuf[0] = $ch; 
                              	for($i = 1; $i < 20; $i++) { 
                                    $prbuf[$i] = $prbuf[$i-1]-9; 
                              	} 
                              	$ch = GoogleCH(c32to8bit($prbuf), 80); 
                              	return sprintf("%u", $ch);
                              }
                              
                              function get_page_rank($url){
                              	$url = preg_replace('/\?.*$/','?',$url);
                              	$reqgr = "info:".$url;
                                  $reqgre = "info:".urlencode($url);
                                  $gch = GoogleCH(strord($reqgr));
                                  $gch = "6".GoogleCHNew($gch);
                                  $querystring = "http://toolbarqueries.google.com/search?client=navclient-auto&ch=".$gch."&ie=UTF-8&oe=UTF-8&features=Rank:FVN&q=".$reqgre;
                                  $patern = '/^http:/';
                                  $patern2 = '/^http:\/\/.*google\..*\/(search|images|groups|news).*/';
                                  $patern3 = '/^http:\/\/localhost.*/';
                                  $patern4 = '/^http:\/\/(127\.|10\.|172\.16|192\.168).*/'; //local ip
                                  if(!preg_match($patern, $url) || preg_match($patern2, $url) ||
                                     preg_match($patern3, $url) || preg_match($patern4, $url)){
                                     	return -1;
                                  }else{
                              			return $querystring;
                                  }
                              } 
                              ?>

                              Comment

                              • squishypimp
                                PostMaster General
                                • Aug 2006
                                • 10781

                                #16
                                Originally posted by Jace
                                squishypimp
                                This message is hidden because squishypimp is on your ignore list.
                                your loss.

                                Comment

                                • borked
                                  Totally Borked
                                  • Feb 2005
                                  • 6284

                                  #17
                                  and to add - I use it in a similar way to you and it gets the pagerank for well over 200,000 domains in less than 30 minutes, so I reckon calling it on the fly would be more than fine for a webpage of sites (count ~10ms /site lookup)

                                  For coding work - hit me up on andy // borkedcoder // com
                                  (consider figuring out the email as test #1)



                                  All models are wrong, but some are useful. George E.P. Box. p202

                                  Comment

                                  • squishypimp
                                    PostMaster General
                                    • Aug 2006
                                    • 10781

                                    #18
                                    Originally posted by borked
                                    A php function for ya:

                                    Code:
                                    header("Content-Type: text/plain; charset=utf-8"); 
                                    
                                    define('GOOGLE_MAGIC', 0xE6359A60); 
                                    
                                    
                                    //unsigned shift right 
                                    
                                    function zeroFill($a, $b) 
                                    
                                    { 
                                        $z = hexdec(80000000);
                                        //echo $z;
                                    
                                            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); 
                                    
                                        //echo $mix[0];
                                    
                                        /*-------------------------------------------- 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 = $_GET['url']; 
                                    //print("url:\t{$_GET['url']}\n"); 
                                    
                                    $ch = "6" . GoogleCH(strord("info:" . $url)); 
                                    
                                    
                                    $fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
                                    if (!$fp) {
                                       echo "$errstr ($errno)<br />\n";
                                    } else {
                                       $out = "GET /search?client=navclient-auto&ch=". $ch .  "&features=Rank&q=info:" . $url . " HTTP/1.1\r\n";
                                       $out .= "Host: www.google.com\r\n";
                                       $out .= "Connection: Close\r\n\r\n";
                                    
                                       fwrite($fp, $out);
                                       
                                       //$pagerank = substr(fgets($fp, 128), 4);
                                       //echo $pagerank;
                                       while (!feof($fp)) {
                                    	$data = fgets($fp, 128);
                                    	$pos = strpos($data, "Rank_");
                                    	if($pos === false){} else{
                                    		$pagerank = substr($data, $pos + 9);
                                    		echo $pagerank;
                                    	}
                                       }
                                       fclose($fp);
                                    }
                                    thats the same as the axslinks uses.

                                    Comment

                                    • borked
                                      Totally Borked
                                      • Feb 2005
                                      • 6284

                                      #19
                                      Originally posted by squishypimp
                                      Code:
                                      <?php 
                                      ....
                                      ?>
                                      beatcha to it

                                      For coding work - hit me up on andy // borkedcoder // com
                                      (consider figuring out the email as test #1)



                                      All models are wrong, but some are useful. George E.P. Box. p202

                                      Comment

                                      • Damian_Maxcash
                                        So Fucking Banned
                                        • Oct 2002
                                        • 12745

                                        #20
                                        Originally posted by Jace
                                        squishypimp
                                        This message is hidden because squishypimp is on your ignore list.
                                        You might actually want to look at that one

                                        I'm still looking BTW.

                                        Comment

                                        • squishypimp
                                          PostMaster General
                                          • Aug 2006
                                          • 10781

                                          #21
                                          Originally posted by borked
                                          beatcha to it
                                          nice one

                                          Comment

                                          • Jace
                                            FBOP Class Of 2013
                                            • Jan 2004
                                            • 35562

                                            #22
                                            Originally posted by damian2001
                                            You might actually want to look at that one

                                            I'm still looking BTW.
                                            I am using that site I posted above, works perfectly, exactly what I wanted

                                            thanks though!!!

                                            Comment

                                            • Damian_Maxcash
                                              So Fucking Banned
                                              • Oct 2002
                                              • 12745

                                              #23
                                              Originally posted by Jace
                                              I am using that site I posted above, works perfectly, exactly what I wanted

                                              thanks though!!!
                                              cool - but I'm gonna find that bloody link anyway - Its turned into a mission now.....

                                              Comment

                                              • Jace
                                                FBOP Class Of 2013
                                                • Jan 2004
                                                • 35562

                                                #24
                                                Originally posted by damian2001
                                                cool - but I'm gonna find that bloody link anyway - Its turned into a mission now.....
                                                hahahaha, man, I know that feeling oh too well

                                                Comment

                                                • SmokeyTheBear
                                                  ►SouthOfHeaven
                                                  • Jun 2004
                                                  • 28609

                                                  #25
                                                  just rename this picture to your domain name

                                                  hatisblack at yahoo.com

                                                  Comment

                                                  • darksoul
                                                    Confirmed User
                                                    • Apr 2002
                                                    • 4997

                                                    #26
                                                    phplinksdirectory has this already incorporated.
                                                    Theres already a library for it in the public domain.
                                                    Best way would be to create a database with domain/pr and
                                                    update it once in a while when gpr updates.
                                                    1337 5y54|)m1n: 157717888
                                                    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                                    Cambooth

                                                    Comment

                                                    Working...