Retrieve Baidu weight sogou Google PR

Source: Internet
Author: User
? Php: Get Baidu weight sogou Google PR x-Dragon QQ: 29295842 * Get Baidu weight * functionbaidu_br ($ s) {$ baidumytool. chinaz. combaidusort. aspx? Host. $ s; $ sitefile_get_contents ($ baidu); file_get_contents (urlencode ($ baidu); preg_match_all (font

? Php // get baidu weight sogou Google PR // X-Dragon QQ: 29295842/* Get baidu weight */functionbaidu_br ($ s) {$ baidu = http://mytool.chinaz.com/baidusort.aspx? Host =. $ s; $ site = file_get_contents ($ baidu); // file_get_contents (urlencode ($ baidu); preg_match_all (font

// Obtain the Baidu weight of the website sogou Google PR
// X-Dragon QQ: 29295842

/* Obtain Baidu weight */
Function baidu_br ($ s ){
$ Baidu = "http://mytool.chinaz.com/baidusort.aspx? Host = ". $ s;
$ Site = file_get_contents ($ baidu); // file_get_contents (urlencode ($ baidu ));
Preg_match_all ('((.*?) <\/Font>) ', $ site, $ count );
// Print_r ($ count );
If (! Empty ($ count [1] [0]) {
Return $ count [1] [0];
}
Else {
Return "! ";
}
Return $ count [1] [0];
}

/* Sogou */
Function sogo ($ s ){
$ Sogo = "http://rank.ie.sogou.com/sogourank.php? Url = ". $ s;
$ Site = file_get_contents ($ sogo );
Preg_match_all ('(sogourank = (.*?) $) ', $ Site, $ count );
If (! Empty ($ count [1] [0]) {
Return $ count [1] [0];
}
Else {
Return "! ";
}
Return $ count [1] [0];
}

/* Google */
Function app_hash_url ($ url ){
$ Seed = "Mining PageRank is against google's terms of service .";
$ Result = 0x01020345;
For ($ I = 0; $ I $ Result ^ = ord ($ seed {$ I % 87}) ^ ord ($ url {$ I });
$ Result = ($ result> 23) & 0x1FF) | $ result <9;
}
Return sprintf ("8% x", $ result );
}
Function get_domain ($ url) {// obtain the primary domain name
// $ Url = "http://www.uncletoo.com/plug/tags? Tag = PHP ";
Preg_match ('@ ^ (? : Http ://)? ([^/] +) @ I ', $ url, $ matches );
Return $ matches [1];
// Echo $ host;
}

Function google_pr ($ url ){

Try
{
$ Url = get_domain ($ url); // obtain the primary domain name
// Echo $ url;
$ PR_CH = app_hash_url ($ url );
$ Url = 'HTTP: // toolbarqueries.google.com/tbr? Client = navclient-auto & features = Rank & q = info: '. $ url.' & ch = '. $ PR_CH;
$ Prtext = file_get_contents ($ url );
If ($ prtext! = ""){
$ Pr = explode (":", $ prtext );
Return $ pr [2];
} Else {
Return "! ";
}
Return "! ";
}
// Capture exceptions
Catch (Exception $ e)
{
Return "! ";
}
}

Echo "baidu --". baidu_br ('HTTP: // www.hf97.com/plus/av.php ');
Echo "sogo --". sogo ('HTTP: // www.hf97.com/plus/av.php ');
Echo "google --". google_pr ('HTTP: // www.hf97.com/plus/av.php ');
?> <无>
  ) ', $ Site, $ count); // print_r ($ count); if (! Empty ($ count [1] [0]) {return $ count [1] [0];} else {return "! ";} Return $ count [1] [0];}/* sogou */function sogo ($ s) {$ sogo =" http://rank.ie.sogou.com/sogourank.php? Url = ". $ s; $ site = file_get_contents ($ sogo); preg_match_all ('(sogourank = (.*?) $) ', $ Site, $ count); if (! Empty ($ count [1] [0]) {return $ count [1] [0];} else {return "! ";} Return $ count [1] [0];}/* google */function app_hash_url ($ url) {$ seed = "Mining PageRank is against google's terms of service. & quot; $ result = 0x01020345; for ($ I = 0; $ I
  
   
> 23) & 0x1FF) | $ result <9;} return sprintf ("8% x", $ result);} function get_domain ($ url) {// get primary domain name // $ url = "http://www.uncletoo.com/plug/tags? Tag = PHP "; preg_match ('@ ^ (? : Http ://)? ([^/] +) @ I ', $ url, $ matches); return $ matches [1]; // echo $ host;} function google_pr ($ url) {try {$ url = get_domain ($ url); // obtain the primary domain name // echo $ url; $ PR_CH = app_hash_url ($ url); $ url = 'HTTP: // toolbarqueries.google.com/tbr? Client = navclient-auto & features = Rank & q = info :'. $ url. '& ch = '. $ PR_CH; $ prtext = file_get_contents ($ url); if ($ prtext! = "") {$ Pr = explode (":", $ prtext); return $ pr [2];} else {return "! ";} Return "! ";}// Catch Exception catch (Exception $ e) {return "! ";}} Echo" baidu --". baidu_br ('HTTP: // www.hf97.com/plus/av.php'); echo "sogo --". sogo ('HTTP: // www.hf97.com/plus/av.php'); echo "google --". google_pr ('HTTP: // www.hf97.com/plus/av.php');?>
  

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.