DedeCMS接入百度站点天级收录及周级收录API

  	 //百度资源平台自动推送    	   $notice = '完成百度资源平台收录推送!';    	    $type = strpos($flag,'h')===false?'batch':'realtime';//头条文章自动调用天级接口,否则调用周级接口    	    $chinesetype = strpos($flag,'s')===false?'周级':'天级';    	    $posturl = "https://m.02405.com/view.php?id=".$aid;    	    $api = 'http://data.zz.baidu.com/urls?appid=1621527503774131&token=plpD8YRwa33J5WKu&type='.$type;    	    $ch = curl_init();    	    $options =  array(    	      CURLOPT_URL => $api,    	      CURLOPT_POST => true,    	      CURLOPT_RETURNTRANSFER => true,    	      CURLOPT_POSTFIELDS => $posturl,    	      CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),    	    );    	    curl_setopt_array($ch, $options);    	    $result = curl_exec($ch);    	      

上面代码加到dede/article_add.php中“//返回成功信息”之前。

未经允许不得转载:吾爱主机之家 » DedeCMS接入百度站点天级收录及周级收录API