<tfoot id='7jwzm4bk'></tfoot>
  • <small id='jc179zpj'></small><noframes id='yl89si4e'>

      <legend id='y02zjpd7'><style id='km70igvt'><dir id='p3mr3yez'><q id='qg5ogepn'></q></dir></style></legend>

      • <bdo id='nly2guv3'></bdo><ul id='29423ggs'></ul>
    1. <i id='2393tytd'><tr id='hn9kujsa'><dt id='9rj4uc96'><q id='xvozofi7'><span id='7449bwut'><b id='icpne25u'><form id='movgnqcn'><ins id='z8mt6zej'></ins><ul id='8bwm2jbk'></ul><sub id='0myij17o'></sub></form><legend id='pht3m14x'></legend><bdo id='jgllkcy6'><pre id='8dpat5nn'><center id='x6ytpgru'></center></pre></bdo></b><th id='xyoy34a6'></th></span></q></dt></tr></i><div id='jg56w9i9'><tfoot id='lfc5w6gw'></tfoot><dl id='955qei7y'><fieldset id='7ds5akaa'></fieldset></dl></div>

        精准传达 • 价值共享

        洞悉互联网前沿资讯,探寻网站营销规律

        织梦程序用熊掌号api接入熊掌号自动提交方法

        作者: 庚午网络 | 2020-12-13 03:02 |点击:

        <legend id='9e9j10y0'><style id='gm7xwvqd'><dir id='3b15560u'><q id='1rx8nor9'></q></dir></style></legend>
        1. <i id='twsvzwny'><tr id='9joej8dw'><dt id='ztm77zml'><q id='n9s2yoqx'><span id='fdcevkqj'><b id='fjt9d24s'><form id='043ypcab'><ins id='2n8jl3fb'></ins><ul id='tfqbzt5s'></ul><sub id='tdd5dbrd'></sub></form><legend id='2lc8zrxt'></legend><bdo id='exu9lr2i'><pre id='rrpw3rzu'><center id='duzbzknq'></center></pre></bdo></b><th id='sg9ifca9'></th></span></q></dt></tr></i><div id='2z62rekq'><tfoot id='8ro6k4r8'></tfoot><dl id='lq6u1uns'><fieldset id='4a4wd718'></fieldset></dl></div>

          • <tfoot id='ltil893p'></tfoot>
                <tbody id='kz2s1me3'></tbody>
            1. <small id='mbrdlji5'></small><noframes id='0ae8pg9p'>

                  <bdo id='vqpipjwc'></bdo><ul id='wjg5gvxm'></ul>
                • 最近很多站长朋友来咨询庚午小编,织梦有没有插件或者代码能自动提交熊掌号数据的,期间我也帮助了不少站长,发现还是直接发一个教程,以后大家直接看教程操作。

                  今天教大家学会DedeCMS实现百度熊掌号API提交接口推送(PHP推送)。
                   

                  本教程教大家通过新增内容接口,提交站内 当天新产生 内容的链接。新增内容享受24小时内抓取校验、快速展现优待。

                  API数据提交代码如下(PHP代码)

                  <?php
                  require_once ("include/common.inc.php");
                  require_once "include/arc.partview.class.php";
                  require_once('include/charset.func.php');
                  $year = date("Y");
                  $month = date("m");
                  $day = date("d");
                  $dayBegin = mktime(0,0,0,$month,$day,$year);
                  $dayEnd = mktime(23,59,59,$month,$day,$year);
                  $query = "SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid where pubdate<".$dayEnd." AND pubdate>".$dayBegin."";
                  //echo $query;
                  $urls="";				
                  $dsql->Execute('arch.id,types.typedir',$query);
                  while($row = $dsql->GetArray('arch.id,types.typedir'))
                  {
                  	$urls.="http://www.hulingweb.cn".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";	
                  }
                  $urls=substr($urls,0,-1);
                  $urls	= explode(",",$urls);
                  $api = 'http://data.zz.baidu.com/urls?appid=熊掌号ID&token=密钥&type=realtime'; // 前边的熊掌号ID和密钥换成自己的
                  $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);
                  echo $result;
                  ?>

                  以上的代码只需要改两个地方,上方橙色的地方
                   

                  1、把下方的http://hulingweb.cn 改成你自己绑定熊掌号的网址

                  $urls.="http://hulingweb.cn"

                  2、把API接口改成你自己熊掌号新增内容接口

                  $api = 'http://data.zz.baidu.com/urls?appid=熊掌号ID&token=密钥&type=realtime';

                  好了今天的教程就到这里结束。(懒人直接下载源码)

                  下载地址:https://pan.baidu.com/s/1ye5fEQ4XIN1hFljiwH9Q8A

                   

                   

                  让网站自己提交的方法

                  第一步:在\plus\task目录下新建一个php文件,命名为xzh.php代码如下:

                   

                  require_once(dirname(__FILE__).'/../../include/common.inc.php');

                  require_once(DEDEINC."/arc.partview.class.php");

                  require_once(dirname(__FILE__).'/../../include/charset.func.php');

                  $year = date("Y");

                  $month = date("m");

                  $day = date("d");

                  $dayBegin = mktime(0,0,0,$month,$day,$year);

                  $dayEnd = mktime(23,59,59,$month,$day,$year);

                  $query = "SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid where pubdate<".$dayEnd." AND pubdate>".$dayBegin."";

                  //echo $query;

                  $urls="";                                

                  $dsql->Execute('arch.id,types.typedir',$query);

                  while($row = $dsql->GetArray('arch.id,types.typedir'))

                  {

                      $urls.="$urls.="https://www.xiuzhanwang.com".str_replace("{cmspath}","",$row['typedir'])."/".$row[id].".html".",";".",";        

                  }

                  $urls=substr($urls,0,-1);

                  $tjurl = $urls;

                  $urls  = explode(",",$urls);

                  $api = 'http://data.zz.baidu.com/urls?appid=1567968668883362&token=TqR2soisGxVnnKiN&type=realtime'; // 熊掌号api接口调用地址

                  $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);

                  echo $result;

                  $dsql->ExecuteNoneQuery("Update `xiuzhanwang_sys_task` set sta='成功' where dourl='xzh.php' ");

                  $jieguo = date('Y-m-d H:i:s',time())."返回结果:".$result."\r\n".$tjurl;

                  $numbytes = file_put_contents('xzh.txt', $jieguo); //返回结果

                  exit();

                   

                  第二步:在网站后台系统-计划任务管理里面新增一个任务,运行程序填xzh.php,设定好执行规则。

                   

                  第三步:在模板中用JS调用/plus/task.php?client=js任务执行成功之后会在\plus\task目录下生成一个xzh.txt文件,返回提交结果、任务执行时间、提交的url,

                  二度创作,如有侵权请联系删除。如没特殊注明,文章均为庚午网络原创,转载请注明https://www.hngengwu.com/gengwuwenku/574.html

                      <bdo id='flpje1mv'></bdo><ul id='ztg37pu8'></ul>
                    <i id='n4nvfcs1'><tr id='uv6s7rgs'><dt id='bxg8jqip'><q id='a8b82juf'><span id='vfhwe8rw'><b id='8su74z7v'><form id='h5msdshi'><ins id='2r2d4jwl'></ins><ul id='3izp1f2g'></ul><sub id='6ed6kiee'></sub></form><legend id='i2kkqth2'></legend><bdo id='cl495qvm'><pre id='ws2bbho9'><center id='kq19c8bh'></center></pre></bdo></b><th id='puewipd5'></th></span></q></dt></tr></i><div id='q6ozz4gx'><tfoot id='ng1nq12q'></tfoot><dl id='qjmbaeyp'><fieldset id='idhfxizo'></fieldset></dl></div>

                      <tfoot id='d91ju7xo'></tfoot>
                      <legend id='2o9kvspd'><style id='hofnt6s8'><dir id='fkmf8yyq'><q id='5dqdtv5g'></q></dir></style></legend>

                      <small id='ycy1bglz'></small><noframes id='c94bg42k'>

                      多一份策划方案,总有益处。

                      请直接添加技术总监微信联系咨询

                      网站设计 品牌营销

                      多一份参考,总有益处

                      联系庚午网络,获得专属《策划方案》及报价

                      咨询相关问题或预约面谈,可以通过以下方式与我们联系

                      业务热线:18574395938 / 大客户专线:18574395938