Google /Baidu Ping服务快速收录--php
php中文网
发布时间:2016-07-25 08:51:03
|
1229人浏览过
|
来源于php中文网
原创
Google /Baidu Ping服务快速收录
http://www.phperzone.cn/portal.php?mod=view&aid=743
- /**
- +------------------------------------------------------------------------------
- * 通知搜索引擎过来抓去最新发布的内容。秒收不是梦
- * 目前仅支持Google和Baidu
- +------------------------------------------------------------------------------
- */
- class ping {
-
- public $method, $callback;
-
- public function method($site_name, $site_url, $update_url, $update_rss) {
- $this->method = "
-
-
- weblogUpdates.extendedPing
-
-
{$site_name}
-
{$site_url}
-
{$update_url}
-
{$update_rss}
-
-
";
- return $this->method;
- }
-
- public function _post($url, $postvar) {
- $ch = curl_init();
- $headers = array(
- "POST " . $url . " HTTP/1.0",
- "Content-type: text/xml;charset="utf-8"",
- "Accept: text/xml",
- "Content-length: " . strlen($postvar)
- );
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postvar);
- $res = curl_exec($ch);
- curl_close($ch);
- return $res;
- }
-
- public function google() {
- $this->callback = $this->_post('http://blogsearch.google.com/ping/RPC2', $this->method);
- return strpos($this->callback, "0") ? true : false;
- }
-
- public function baidu() {
- $this->callback = $this->_post('http://ping.baidu.com/ping/RPC2', $this->method);
- return strpos($this->callback, "0") ? true : false;
- }
-
- }
复制代码
|
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
文心一言
文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。
讯飞写作
基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿
即梦AI
一站式AI创作平台,免费AI图片和视频生成。
ChatGPT
最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。