Search the PR value of the website by bookmark

Source: Internet
Author: User
Tags ord query domain

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>







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.