function baidu ($site){
global $fetch;
$apiurl = "http://www.baidu.com/s?wd=site%3A".$site."&ie=utf-8";
$body = $fetch->get($apiurl);
//$body = $fetch->getResponseBody();
preg_match('/百度为您找到相关结果约(.*)个<\/span>/is',$body,$num);
$baidunum = $num[1];
$baidunum = str_replace(",","",$baidunum);
return $baidunum;
}
function google ($site){
global $fetch;
$apiurl = "http://www.google.com.hk/search?hl=zh-HK&q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/約有 (.*) 項結果/is',$body,$num);
$googlenum = $num[1];
$googlenum = str_replace(",","",$googlenum);
return $googlenum;
}
function bing ($site){
global $fetch;
$apiurl = "http://cn.bing.com/search?q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/<div class=\"sb_rc_btm sb_rc_btm_p\">(.*) 条结果<\/div>/is',$body,$num);
$bingnum = $num[1];
$bingnum = str_replace(",","",$bingnum);
return $bingnum;
}
function so ($site){
global $fetch;
$apiurl = "http://www.so.com/s?q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/<p class=\"ws-total\">找到相关结果约(.*)个<\/p>/is',$body,$num);
$sonum = $num[1];
$sonum = str_replace(",","",$sonum);
return $sonum;
}
function sogou ($site){
global $fetch;
$apiurl = "http://www.sogou.com/web?query=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/<span id=\"scd_num\">(.*)<\/span> <!--resultbarnum:/',$body,$num);
$sogounum = $num[1];
$sogounum = str_replace(",","",$sogounum);
return $sogounum;
}
function soso ($site){
global $fetch;
$apiurl = "http://www.soso.com/q?w=site%3A".$site;
$body1 = $fetch->get($apiurl);
$body = iconv("GBK","UTF-8",$body1);
preg_match('/<div id=\"sInfo\">搜索到约(.*)项结果/is',$body,$num);
$sosonum = $num[1];
$sosonum = str_replace(",","",$sosonum);
return $sosonum;
}
function yahoo ($site){
global $fetch;
$apiurl = "http://www.yahoo.cn/s?q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/<div class=\"s_info\">找到相关网页约(.*)条<\/div>/is',$body,$num);
$yahoonum = $num[1];
$yahoonum = str_replace(",","",$yahoonum);
return $yahoonum;
}
function youdao ($site){
global $fetch;
$apiurl = "http://www.youdao.com/search?q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/<span class=\"srd\">共约(.*)条结果<\/span>/is',$body,$num);
$youdaonum = $num[1];
$youdaonum = str_replace(",","",$youdaonum);
return $youdaonum;
}
function jike ($site){
global $fetch;
$apiurl = "http://www.jike.com/so?q=site%3A".$site;
$body = $fetch->get($apiurl);
preg_match('/找到约<i>(.*)<\/i>条结果/is',$body,$num);
$jikenum = $num[1];
$jikenum = str_replace(",","",$jikenum);
return $jikenum;
}