Wrote a small thing to record Baidu and Google for the site of the situation, can now query, in fact, there is no difficulty, that is, to file remote files, and then analysis.
On the seemingly check Google PR is just file an address, so said there is no difficulty.
The complete code is as follows, file obtains files, analysis, output:
Copy the Code code as follows:
$seodetail = Array ();
$domain =!empty ($_get[' Q ')? $_get[' Q ']: ' www.mycodes.net ';
Baidudetail ($domain);
Googledetail ($domain);
Var_dump ($seodetail);
function Baidudetail ($domain) {
$baidu _site = ' Http://www.baidu.com/baidu?word=site%3A '. $domain;
$baidu _link = ' Http://www.baidu.com/baidu?word=link%3A '. $domain;
$baidu _domain = ' Http://www.baidu.com/baidu?word=domain%3A '. $domain;
Getdetail ($baidu _site, ' baidu_site ', ' related pages ', ' articles, Time ');
Getdetail ($baidu _link, ' baidu_link ', ' related pages ', ' articles, Time ');
Getdetail ($baidu _domain, ' baidu_domain ', ' related pages ', ' articles, Time ');
}
function Googledetail ($domain) {
$google _site = ' Http://www.google.cn/search?hl=zh-CN&q=site%3A '. $domain;
$google _link = ' Http://www.google.cn/search?hl=zh-CN&q=link%3A '. $domain;
Getdetail ($google _site, ' google_site ', ' a result, ', ' A. (Search time ');
Getdetail ($google _link, ' google_link ', ' about ' , ' necklace received ');//102
}
function Getdetail ($url, $type, $WORDF, $wordb) {
$pagecontent = @file ($url);
$pagecontent = Implode (' ', $pagecontent);
$pagecontent = substr (Strstr ($pagecontent, $WORDF), strlen ($WORDF));
$pagecontent = Substr_replace ($pagecontent, ", Strpos ($pagecontent, $wordb));
Returndetail ($pagecontent, $type);
}
function Returndetail ($content, $type) {
Global $seodetail;
$seodetail [$type] = empty ($content)? 0: $content;
}
?>
http://www.bkjia.com/PHPjc/328091.html www.bkjia.com true http://www.bkjia.com/PHPjc/328091.html techarticle wrote a small thing to record Baidu and Google for the site of the situation, can now query, in fact, there is no difficulty, that is, to file remote files, and then analysis. Yes, it looks like ...