GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   A page rank button for a remote site...is it possible? (https://gfy.com/showthread.php?t=670810)

Jace 10-26-2006 10:59 PM

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
http://www.prchecker.info/PR2_img.gif

is there any way to show the pagerank of other sites in a button like that?

Damian_Maxcash 10-26-2006 11:03 PM

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

I could be some time :)

Jace 10-26-2006 11:06 PM

Quote:

Originally Posted by damian2001 (Post 11164788)
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

emthree 10-26-2006 11:06 PM

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.

squishypimp 10-26-2006 11:08 PM

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

Bama 10-26-2006 11:14 PM

I offer this service on xxxwebmasters.com

Go grab one

Jace 10-26-2006 11:26 PM

Quote:

Originally Posted by squishypimp (Post 11164818)
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

Jace 10-26-2006 11:28 PM

Quote:

Originally Posted by Bama (Post 11164844)
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

Jace 10-26-2006 11:28 PM

I found one you all

http://www.pageranker.org/

Tempest 10-26-2006 11:30 PM

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.

squishypimp 10-26-2006 11:30 PM

Quote:

Originally Posted by Jace (Post 11164901)
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 :)

Jace 10-26-2006 11:36 PM

Quote:

Originally Posted by Tempest (Post 11164920)
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

borked 10-26-2006 11:37 PM

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);
}


Jace 10-26-2006 11:37 PM

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

squishypimp 10-26-2006 11:38 PM

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;
    }
}
?>


squishypimp 10-26-2006 11:39 PM

Quote:

Originally Posted by Jace (Post 11164958)
squishypimp
This message is hidden because squishypimp is on your ignore list.

your loss.

borked 10-26-2006 11:40 PM

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)

squishypimp 10-26-2006 11:40 PM

Quote:

Originally Posted by borked (Post 11164957)
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. :)

borked 10-26-2006 11:42 PM

Quote:

Originally Posted by squishypimp (Post 11164970)
Code:

<?php
....
?>


beatcha to it :winkwink: :thumbsup

Damian_Maxcash 10-26-2006 11:44 PM

Quote:

Originally Posted by Jace (Post 11164958)
squishypimp
This message is hidden because squishypimp is on your ignore list.

You might actually want to look at that one :thumbsup

I'm still looking BTW. :(

squishypimp 10-26-2006 11:48 PM

Quote:

Originally Posted by borked (Post 11164992)
beatcha to it :winkwink: :thumbsup

nice one :)

Jace 10-26-2006 11:56 PM

Quote:

Originally Posted by damian2001 (Post 11164995)
You might actually want to look at that one :thumbsup

I'm still looking BTW. :(

I am using that site I posted above, works perfectly, exactly what I wanted

thanks though!!!

Damian_Maxcash 10-27-2006 12:00 AM

Quote:

Originally Posted by Jace (Post 11165068)
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..... :upsidedow

Jace 10-27-2006 12:02 AM

Quote:

Originally Posted by damian2001 (Post 11165085)
cool - but I'm gonna find that bloody link anyway - Its turned into a mission now..... :upsidedow

hahahaha, man, I know that feeling oh too well

SmokeyTheBear 10-27-2006 02:55 AM

just rename this picture to your domain name

http://tools.webspacemania.com/pager...outube.com.png

darksoul 10-27-2006 03:11 AM

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.


All times are GMT -7. The time now is 10:38 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123