In the Chrome or Firefox have PR query tool, visit a webpage, automatically display the current site PR value.
But not all the pages need to query, so get a query PR bookmark, only when you need to query, then click on the query.
JavaScript: (function ()%7bvar%20d=document;var%20l=location;var%20u=l.tostring (); Var%20s=d.createelement (' Script '); var%20b= ' http://uicss.cn/pr/'; var%20n=b+ ' url.php? ' + ' &url= ' +encodeuricomponent (u); window.open (n);%7d) ();
How to use:
Add the above JS code to your bookmarks on it. In the need to query the PR URL, direct point bookmark can:
The full text is over.
The realization thought of attaching url.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 >>) & 0x1ff) $Result << 9;
}
return sprintf ("8%x", $Result);
}
function PageRank ($domain)
{
$StartURL = "http:// 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" or else return $pagerank;
}
$website = $html _url
$website = Str_replace ("http://", "", $website);
@ $pr = PageRank ("$webs Ite ");
@ date_default_timezone_set (PRC);
$now _date = Date ("Y-year N-month J-Day G-time I-minute S");
?
<! DOCTYPE html>
<meta charset= "Utf-8"/>
<TITLE>PR Query </title
<body>
<?php
Echo ' <p id= ' pr_info ' ><b> '. $html _url. ' </b> PR is '. $pr. ' <a href= "http://uicss.cn/pr/" ></a></p><p><span> query time: '. $now _date. ' </span></p> ';
?
</body>