Esempio n. 1
0
/**
* Returns checksum for the given url
*
* @param string $aUrl
*
* @return string
*/
function get_checksum($aUrl)
{
    return '6' . GCH(strord('info:' . $aUrl));
}
Esempio n. 2
0
function getrank($url)
{
    define('GOOGLE_MAGIC', 0xe6359a60);
    $url = 'info:' . $url;
    $ch = GoogleCH(strord($url));
    $file = "http://www.google.com/search?client=navclient-auto&ch=6{$ch}&features=Rank&q={$url}";
    $data = file($file);
    $rankarray = explode(':', $data[2]);
    $rank = $rankarray[2];
    return $rank;
}
Esempio n. 3
0
function PageRank($domain)
{
    $result = get_content('http://www.google.com/search?client=navclient-auto&ch=6' . GCH(strord('info:' . $domain)) . '&ie=UTF-8&oe=UTF-8&features=Rank&q=info:' . urlencode($domain));
    if (preg_match('/\\d+:\\d+:(\\d+)/', $result, $matches)) {
        return intval($matches[1]);
    } else {
        return 0;
    }
}
Esempio n. 4
0
function getrank($url)
{
    $pagerank = "0";
    $ch = "6" . GoogleCH(strord("info:" . $url));
    $fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
    if (!$fp) {
        $pagerank = "-1";
        //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);
        while (!feof($fp)) {
            $data = fgets($fp, 128);
            $pos = strpos($data, "Rank_");
            if ($pos === false) {
            } else {
                $pagerank = substr($data, $pos + 9);
            }
        }
        fclose($fp);
    }
    return $pagerank;
}
Esempio n. 5
0
 function getPR($_url)
 {
     $url = 'info:' . $_url;
     $ch = GCH(strord($url));
     $url = '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={$url}");
     $pr_str = implode("", $pr);
     return substr($pr_str, strrpos($pr_str, ":") + 1);
 }
Esempio n. 6
0
function google_getrank($url)
{
    // [url]http://www.example.com/[/url] - Checksum: 6540747202
    //$url = 'info:'.$_GET['url'];
    $url = 'info:' . $url;
    //print("url:\t{$_GET['url']}\n");
    $ch = GoogleCH(strord($url));
    //printf("ch:\t6%u\n",$ch);
    $file = "http://www.google.com/search?client=navclient-auto&ch=6{$ch}&features=Rank&q={$url}";
    //print "<hr>$file<hr>";
    //  $data = file($file);
    global $site_auditor;
    $site_auditor->user_agent->get($file);
    $response = $site_auditor->user_agent->currentResponse();
    if ($response["code"] != "200") {
        return "<a href='{$file}' target='_blank'>Failed</a>";
    }
    //echo $data[2];
    //echo "<a href='$file'>view pagerank</a>";
    //   $rankarray = explode (':', $data[2]);
    $rankarray = explode(':', $response["body"]);
    $rank = $rankarray[2];
    return trim($rank);
}
Esempio n. 7
0
function PageRank($domain)
{
    $url = 'info:' . $domain;
    $hash = '6' . c(GCH(strord($url)));
    $fetch = 'http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=' . $hash . '&ie=UTF-8&oe=UTF-8&features=Rank&q=' . $url;
    $result = get_content($fetch);
    if (strlen($result) > 0) {
        return intval(substr($result, 9));
    } else {
        return 0;
    }
}