Home > php教程 > php手册 > 百度/谷歌Ping

百度/谷歌Ping

WBOY
Release: 2016-06-07 11:43:20
Original
1233 people have browsed it

百度/谷歌Ping类,通知爬虫抓取,秒收不是梦
上次看到了一篇介绍Ping的文章,正好我的博文也用到Ping,在这里我重写了一下Ping类,在类中我增加了一些配置项,使使用起来更加的便捷实用。
主要的配置项有:      //Ping 配置<br>     'PING_CONFIG'=>array(<br>         'IS_PING_ON'=>0,   //是否开启Ping;1开启Ping;0不开启;默认为不开启<br>         'SITE_NAME'=>'个人网站',           //网站名称<br>         'SITE_URL'=>'http://www.xxx.com/',        //网站地址<br>         'UPDATE_URL'=>'http://www.xxx.com/',    //网站基本地址<br>         'UPDATE_RSS_URL'=>'',        //更新的Rss地址  没有可以为空<br>         ),在开启Ping的状态下如果使用类就很简单了,只要传入一个id即可:     import('Class.Ping',APP_PATH);// 导入Ping类<br>     $ping=new Ping(10);//传入插入文章的id<br>     if(!$ping->google() ||!$ping->baidu()){<br>         if(!$ping->google()){<br>           $this->error('谷歌Ping失败');<br>         }else{<br>           $this->error('百度Ping失败');<br>        }<br>     }else{<br>         $this->success('Ping成功');<br>     }未在配置项中做相关的设置也可以在使用的时候对参数进行设置,用法如下:         import('Class.Ping',APP_PATH);// 导入Ping类<br>            $param=array('site_name'=>'个人网站','site_url'=>'wei416978817.byethost33.com/','id'=>10,'updata_rss_url'=>'');<br>         $ping=new Ping($param);<br>         if(!$ping->google() ||!$ping->baidu()){<br>             if(!$ping->google()){<br>                 $this->error('谷歌Ping失败');<br>             }else{<br>                 $this->error('百度Ping失败');<br>             }<br>         }else{<br>             $this->success('Ping成功');<br>         }真的很好用哦!以前谷歌总是不收录,我就Ping了一下,昨天立马显现了效果
百度/谷歌Ping
有空的童鞋去,http://wei416978817.byethost33.com/,给我点流量吧,少的可怜呀 555。。。。%>_ 附件 Ping.class.rar ( 1.92 KB 下载:115 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template