百度/谷歌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了一下,昨天立马显现了效果
有空的童鞋去,http://wei416978817.byethost33.com/,给我点流量吧,少的可怜呀 555。。。。%>_
Ping.class.rar
( 1.92 KB 下载:115 次 )
AD:真正免费,域名+虚机+企业邮箱=0元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Notepad++7.3.1
Easy-to-use and free code editor