
帝国CMS百度主动提交URL和熊掌号修改方法,首先打开ecmsinfo.php,添加以下代码
打开listinfo.php ,添加提交按钮代码
打开userfun.php,,添加提交函数
function ePostBaiduSitemap($id, $_urls) {
$site = 'https://www.pc07.com';
$token = 'JG43q1HpKMWiNQ3D';
$countcount = count($id);
if (empty($count)) {
printerror("未选择信息ID", "", 1, 0, 1);
}
$urls = array();
for ($i = 0; $i < $count; $i++) {
$id[$i] = (int) $id[$i];
if (array_key_exists($id[$i], $_urls)) {
$urls[] = $_urls[$id[$i]];
}
}
$api = "http://data.zz.baidu.com/urls?site=$site&token=$token";
$ch = curl_init();
$options = array(CURLOPT_URL = > $api, CURLOPT_POST = > true, CURLOPT_RETURNTRANSFER = > true, CURLOPT_POSTFIELDS = > implode("n", $urls), CURLOPT_HTTPHEADER = > array('Content-Type: text/plain'), );
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
$httpstat = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpstat == 200) {
$obj = json_decode($result);
printerror("今天剩余{$obj->remain}条,成功提交{$obj->success}条", "", 1, 0, 1);
} else {
printerror('推送失败', "", 1, 0, 1);
}
}
function ePostrealtime($id, $_urls) {
$site = 'https://www.pc07.com';
$token = 'HUuRZYgrlGLrVysh';
$appid = '1585197816243468';
$countcount = count($id);
if (empty($count)) {
printerror("未选择信息ID", "", 1, 0, 1);
}
$urls = array();
for ($i = 0; $i < $count; $i++) {
$id[$i] = (int) $id[$i];
if (array_key_exists($id[$i], $_urls)) {
$urls[] = $_urls[$id[$i]];
}
}
$api = "http://data.zz.baidu.com/urls?appid=$appid&token=$token&type=realtime";
$ch = curl_init();
$options = array(CURLOPT_URL = > $api, CURLOPT_POST = > true, CURLOPT_RETURNTRANSFER = > true, CURLOPT_POSTFIELDS = > implode("n", $urls), CURLOPT_HTTPHEADER = > array('Content-Type: text/plain'), );
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
$httpstat = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpstat == 200) {
$obj = json_decode($result);
printerror("今天剩余{$obj->remain_realtime}条,成功提交{$obj->success_realtime}条", "", 1, 0, 1);
} else {
printerror('推送失败', "", 1, 0, 1);
}
}
function ePostbatch($id, $_urls) {
$site = 'https://www.pc07.com';
$token = 'HUuRZYgrlGLrVysh';
$appid = '1585197816243468';
$countcount = count($id);
if (empty($count)) {
printerror("未选择信息ID", "", 1, 0, 1);
}
$urls = array();
for ($i = 0; $i < $count; $i++) {
$id[$i] = (int) $id[$i];
if (array_key_exists($id[$i], $_urls)) {
$urls[] = $_urls[$id[$i]];
}
}
$api = "http://data.zz.baidu.com/urls?appid=$appid&token=$token&type=batch";
$ch = curl_init();
$options = array(CURLOPT_URL = > $api, CURLOPT_POST = > true, CURLOPT_RETURNTRANSFER = > true, CURLOPT_POSTFIELDS = > implode("n", $urls), CURLOPT_HTTPHEADER = > array('Content-Type: text/plain'), );
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
$httpstat = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpstat == 200) {
$obj = json_decode($result);
printerror("今天剩余{$obj->remain_batch}条,成功提交{$obj->success_batch}条", "", 1, 0, 1);
} else {
printerror('推送失败', "", 1, 0, 1);
}
}
本文标签:
声明:本文由代码号注册/游客用户【怀蕊】供稿发布,本站不对用户发布的帝国CMS百度主动提交URL和熊掌号提交的方法信息内容原创度和真实性等负责。如内容侵犯您的版权或其他权益,请留言并加以说明。站长审查之后若情况属实会及时为您删除。同时遵循 CC 4.0 BY-SA 版权协议,尊重和保护作者的劳动成果,转载请标明出处链接和本声明内容。本文作者:怀蕊» /dmh/4332.html
很赞哦! (0)