相关推荐
php实现查询百度google收录情况(示例代码)
2024-11-10 16:08
<?php$seodetail = array();$domain = !empty($_GET['q']) ? $_GET['q'] : 'www.mycodes.net';baidudetail($domain);googledetail($domain);var_dump($seodetail);

php实现查询百度google收录情况(示例代码)

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', '相关网页', '篇,用时');    getdetail($baidu_link, 'baidu_link', '相关网页', '篇,用时');    getdetail($baidu_domain, 'baidu_domain', '相关网页', '篇,用时');}

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> 个结果,', ' 个。 (搜索用时');    getdetail($google_link, 'google_link', '<font size=-1>约有 <b>', '</b> 项链接到 <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);}

    以上就是本篇文章【php实现查询百度google收录情况(示例代码)】的全部内容了,欢迎阅览 ! 文章地址:http://fhzcwj.xhstdz.com/quote/3512.html 
     栏目首页      相关文章      动态      同类文章      热门文章      网站地图      返回首页 物流园资讯移动站 http://fhzcwj.xhstdz.com/mobile/ , 查看更多   
发表评论
0评