I wrote a small item to record the indexing of the site by baidu and google. now I can query it. In fact, there is no difficulty. I just need to go to the file to get a remote file and analyze it. By the way, it seems that the query of googlepr is just an address of file, so there is no difficulty in writing a small item to record the indexing of the site by baidu and google. now you can query it, in fact, there is no difficulty, that is, to go to the file for a remote file, and then analyze it.
By the way, it seems that google pr is only an address of file, so there is no difficulty.
The complete code is as follows. file is used to obtain, analyze, and output files:
The code is as follows:
$ Seodetail = array ();
$ Domain =! Empty ($ _ GET ['Q'])? $ _ GET ['Q']: 'www .bitscn.com;
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', 'webpage related ', 'article, Time ');
Getdetail ($ baidu_link, 'Baidu _ link', 'webpage related ', 'article, Time ');
Getdetail ($ baidu_domain, 'Baidu _ domain ', 'webpage related', 'article, 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 ','Results. (Search time ');
Getdetail ($ google_link, 'Google _ link', 'about','Necklace receipt'); // 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;
}
?>