【威尼斯手机平台】搜索引擎,用来查询google 收录代码
分类:威尼斯手机平台

本代码是一款站长常用工具了,用来询问google 收录代码,能够查询天

<option value="1">自定义天数</option>
      <option value="d">查询前几天援用景况</option>
      <option value="w">查询近期1星期收音和录音景况</option>
      <option value="m">查询前段时间12月接纳情形</option>
      <option value="m2">查询方今4月起用情状</option>
      <option value="m3">查询如今一月收音和录音景况</option>
      <option value="m6">查询近期5月重用场境</option>
      <option value="y">查询近日1年收音和录音情状</option>
      <option value="all">查询总的(全数日期)收录意况</option>

php ,模拟,搜索引擎,访谈网页时是不是富含一些有关参数上面咱们就来效仿搜索引擎采访网址呢。

option value=1自定义天数/option option value=d查询今日重用情状/option option value=w查询这段时间1礼拜收音和录音情状/option option value=m查询近期12月接纳情状/option option value=m2询问近期3月收音和录音情况/option option value=m3查询这几天二月录取情状/option option value=m6询问近些日子三月圈定意况/option option value=y查询近年来1年收音和录音情状/option option value=all查询总的收音和录音情形/option

等信息。

<?php

等信息。

function GetPage($url)
{
$buf=parse_url($url);
if($buf['scheme']=="http")//如果是URL
 {
 $host=$buf['host'];
 $page=$buf['path'];
 if(trim($buf['query'])!=="") $page.="?".trim($buf['query']);

function GetPage($url)
{
$buf=parse_url($url);
if($buf['scheme']=="http")//如果是URL
 {
 $host=$buf['host'];
 $page=$buf['path'];
 if(trim($buf['query'])!=="") $page.="?".trim($buf['query']);

function GetPage($url){$buf=parse_url($url);if($buf['scheme']==http)//如果是URL{$host=$buf['host'];$page=$buf['path'];if(trim($buf['query'])!==) $page.=?.trim($buf['query']);

 $myHeader="GET $url HTTP/1.1rn";
 $myHeader.="Host: $hostrn";
 $myHeader.="Connection: closern";
 $myHeader.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5rn";
 $myHeader.="Accept-Language: zh-cn,zh;q=0.5rn";
 $myHeader.="Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7rn";
 $myHeader.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.7.6) Gecko/20050226 Firefox/1.0.1 Web-Sniffer/1.0.20rn";
 $myHeader.="Referer: ";

 $myHeader="GET $url HTTP/1.1rn";
 $myHeader.="Host: $hostrn";
 $myHeader.="Connection: closern";
 $myHeader.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5rn";
 $myHeader.="Accept-Language: zh-cn,zh;q=0.5rn";
 $myHeader.="Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7rn";
 $myHeader.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.7.6) Gecko/20050226 Firefox/1.0.1 Web-Sniffer/1.0.20rn";
 $myHeader.="Referer: ";

$myHeader=GET $url HTTP/1.1rn;$myHeader.=Host: $hostrn;$myHeader.=Connection: closern;$myHeader.=Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5rn;$myHeader.=Accept-Language: zh-cn,zh;q=0.5rn;$myHeader.=Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7rn;$myHeader.=User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.7.6) Gecko/20050226 Firefox/1.0.1 Web-Sniffer/1.0.20rn;$myHeader.=Referer: $host/rnrn;

 $server=$host;
 $port=80;

 $server=$host;
威尼斯手机平台, $port=80;

$server=$host;$port=80;

 $res="";
 if(false!==($fp = @fsockopen ($server, $port, $errno, $errstr, 30)))
  {
  @fputs ($fp, $myHeader);
  while (!@feof($fp)) $res.= @fgets ($fp, 1024);
  @fclose ($fp);
  }
 else return false;

 $res="";
 if(false!==($fp = @fsockopen ($server, $port, $errno, $errstr, 30)))
  {
  @fputs ($fp, $myHeader);
  while (!@feof($fp)) $res.= @fgets ($fp, 1024);
  @fclose ($fp);
  }
 else return false;

$res=;if(false!==($fp = @fsockopen ($server, $port, $errno, $errstr, 30))){@fputs ($fp, $myHeader);while (!@feof($fp)) $res.= @fgets ($fp, 1024);@fclose ($fp);}else return false;

 if(strlen($res)==0) return false;
 
 return $res;
 }
else//即使是当麻芋果件
 {
 $fileName=$url;
 if(false!==@file_exists($fileName))
  {
  if(false!==($buf=@implode("",file($fileName)))&&@strlen($buf)>0)
   {
      
    return $buf;
   }
  else return false;
  }
 else return false;
 }
}

 if(strlen($res)==0) return false;
 
 return $res;
 }
else//假若是地面文件
 {
 $fileName=$url;
 if(false!==@file_exists($fileName))
  {
  if(false!==($buf=@implode("",file($fileName)))&&@strlen($buf)>0)
   {
      
    return $buf;
   }
  else return false;
  }
 else return false;
 }
}

if(strlen($res卡塔尔==0State of Qatar return false;return $res;}else//假设是地点文件{$fileName=$url;if(false!==@file_exists($fileName)){if(false!==($buf=@implode(,file($fileName)))@strlen($buf)0) {return $buf;}else return false;}else return false;}}

function  GetContent($str,$x,$y){ 
 $tem=strstr($str,$x);
 return substr($tem,0, strpos($tem,$y));
}

function  GetContent($str,$x,$y){ 
 $tem=strstr($str,$x);
 return substr($tem,0, strpos($tem,$y));
}

function GetContent($str,$x,$y){$tem=strstr($str,$x);return substr($tem,0, strpos($tem,$y));}

对获取的google音讯举行拆解剖判何况在本地。

?>

对得到的google音信进行解析並且在该地。

if (isset($q))
{
$TheUrl="";

if (isset($q)){$TheUrl=+site:.$q.num=20complete=1hl=zh-CNlr=newwindow=1as_qdr=.$t.start=.$p.sa=N;

 $TheThie=GetPage($TheUrl);
}
 $TheBody=GetContent($TheThie,"<div id=res class=med>","<div id=bsf style");
    $TheBody=iconv( "UTF-8", "gb2312//IGNORE" , $TheBody);
 $TheBody=str_replace("<!--z--><p><i>","<!--z--><!--<p><i>",$TheBody);
 $TheBody=str_replace('<br clear="all"/>','<br clear="all"/>',$TheBody);
    $TheBody=preg_replace('<a href="/search?num=20(.+?)amp;as_qdr=(.+?)&q=site:(.+?)&start=(.+?)&sa=N">','a href=?q=$3&t=$2&p=$4>    <!--z--',$TheBody);
 $TheBody=str_replace("该网址大概满含恶意软件,有非常的大希望会有毒你的微处理器。","",$TheBody卡塔尔(قطر‎;
 $TheBody=str_replace("/interstitial?url=","",$TheBody);
 $TheBody=str_replace("- <nobr>","",$TheBody);
 $TheBody=str_replace("雷同网页","",$TheBodyState of Qatar;
        $total=GetContent($TheThie,"</b></div><p>","</b>

$TheThie=GetPage($TheUrl);}$TheBody=GetContent($TheThie,div id=res class=med,div id=bsf style); $TheBody=iconv( UTF-8, gb2312//IGNORE , $TheBody);$TheBody=str_replace(!--z--pi,!--z--!--pi,$TheBody);$TheBody=str_replace('br clear=all/','br clear=all/',$TheBody); $TheBody=preg_replace('a href=/search?num=20(.+?)amp;as_qdr=(.+?)amp;q=site:(.+?)amp;start=(.+?)amp;sa=N','a href=?q=$3t=$2p=$4nbsp;nbsp;nbsp;nbsp;!--z--',$TheBody);$TheBody=str_replace(该网址或然含有恶意软件,有不小只怕会毁伤你的微计算机。,,$TheBody卡塔尔;$TheBody=str_replace(/interstitial?url=,,$TheBody);$TheBody=str_replace(- nobr,,$TheBody);$TheBody=str_replace(相近网页,,$TheBody卡塔尔(قطر‎; $total=GetContent($TheThie,/b/divp,/b - b卡塔尔国; $total=iconv( UTF-8, gb2312//IGNORE , $total卡塔尔; $total=GetContent($total,有 b,/b 项卡塔尔国;$total=str_replace(有 b,,$total);$total=str_replace(,,,$total); $total=intval($total);

  • <b>");
            $total=iconv( "UTF-8", "gb2312//IGNORE" , $total);
            $total=GetContent($total,"有 <b>","</b> 项");
     $total=str_replace("有 <b>","",$total);
     $total=str_replace(",","",$total);
            $total=intval($total);

本文由威尼斯在线注册平台发布于威尼斯手机平台,转载请注明出处:【威尼斯手机平台】搜索引擎,用来查询google 收录代码

上一篇:内需在意php获取路线用的是realpath,//与access连接要用到com接口了 下一篇:没有了
猜你喜欢
热门排行
精彩图文