Wrote a small thing to record Baidu and Google for the site included, now can query, in fact, it is not difficult, is to file the remote files, and then analysis.
Yes, looks like Google PR thing is just a file address, so said there is no difficulty.
The complete code is as follows, file obtains the document, analyzes, outputs:
Copy Code code as follows:
<?php
$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, when ');
Getdetail ($baidu _link, ' baidu_link ', ' related pages ', ' articles, when ');
Getdetail ($baidu _domain, ' baidu_domain ', ' related pages ', ' articles, when ');
}
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 ', ' </b> results, ', '. (In search of ");
Getdetail ($google _link, ' google_link ', ' <font size=-1> about <b> ', ' </b> necklace received <b> '); 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;
}
?>