php向wordpress等支援xmlrpc的網站離線發帖的代碼_PHP教程

來源:互聯網
上載者:User
上周做了一個銀魂的網站
http://www.iyinhun.com
喜歡吐槽的熱血動畫的粉絲可以看看。

因為一個人做,比較吃力,我就想做一個自動維護程式(其實就是採集器的意思)
下面公布一下php向這類網站發送文章的代碼(php向wordpress,blogbus,cnblogs等支援xmlrpc的網站離線發帖的代碼)
分類屬性(categories,mt_keywords)自己改。
附件裡是wordpress xmlrpc協議的類庫

function send_to_other($web,$title,$con,$USER,$PASS,$count=-1)  { $client = new IXR_Client($web);        $content['title'] = $title;        //$get_post_info->post_category;        $content['categories'] = array("同人");        $content['description'] = $con;       // $content['custom_fields'] = array( array('key' => 'my_custom_fied','value'=>'yes') );        $content['mt_keywords'] = '同人';      if (!$client->query('metaWeblog.newPost','', $USER,$PASS, $content, true))         {            die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());          }        $ID =  $client->getResponse();                if($ID)        {           // echo 'Post published with ID:#'.$ID;        }       return $post_ID;  }  

http://www.bkjia.com/PHPjc/444555.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/444555.htmlTechArticle上周做了一個銀魂的網站 http://www.iyinhun.com 喜歡吐槽的熱血動畫的粉絲可以看看。 因為一個人做,比較吃力,我就想做一個自動維護程式(其實...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.