Web Design
Mobile Internet
Brand Design
Innovative
News
Encyclopedias

Php View the pr code and firefox Query the pr value of the website with bookmarks

Date:2013-02-17 Source: Shangpin China Type: website encyclopedia
Word Size: small   medium   big

Beijing website construction The company sells products in China: there is a pr query tool in Chrome or Firefox. When visiting a website, it automatically displays the current Website production The pr value of.

But not all the pages need to be queried, so we got a bookmark to query pr, and only click Query when we need to query.

The idea of implementing pr with php:

<? php
$url = $_GET['url'];
$html_url = htmlspecialchars($url);

function HashURL($url)
{$SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE.";
$Result = 0x01020345;
for ($i=0; $i<strlen($url); $ i++)
{
$Result ^= ord($SEED{$i%87}) ^ ord($url{$i});
$Result = (($Result >> 23) & 0x1FF) | $Result << 9;
}
return sprintf("8%x", $Result);
}

function pagerank($domain)
{
$StartURL = " //toolbarqueries.google.com/tbr?client=navclient -auto&features=Rank:&q=info:";
$GoogleURL = $StartURL.$domain. '& ch='. HashURL($domain);
$fcontents = file_get_contents("$GoogleURL");
$pagerank = substr($fcontents,9);
if (!$pagerank) return "0"; else return $pagerank;
}

$website = $html_url;
$website = str_replace("//","",$website);
@ $pr = pagerank("$website");
@ date_default_timezone_set(PRC);
$now_date=date ("G hour, i minute, s second, n month, j day, Y year");
?>

<! DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PR Query</title>
</head>
<body>
<? php
echo '<p id="pr_info"><b>'.$ html_url.'</ b> PR of is'$ pr.' <a href=" //upload.chinaz.com// "/></a></p><p><span>Query time: '. $now_date.'</span></p>';
?>
</body>
</html>



javascript:(function()%7Bvar%20d=document; var%20l=location; var%20u=l.toString(); var%20s=d.createElement('script'); var%20b=' //uicss.cn/pr/ '; var%20n=b+'url.php?'+'& url='+encodeURIComponent(u); window.open(n);% 7D)();
usage method:

Add the above js code to your bookmarks. At the website where you need to query pr, click bookmark directly:

The full text has ended.

This article was published on Beijing website production Company Shangpin China //ihucc.com/


Please contact our consultant

+86 10-60259772

Please provide your contact number. The project manager of shangpin China will contact you as soon as possible.