Php code for offline posting to wordpress and other websites that support xmlrpc _ PHP Tutorial

Source: Internet
Author: User
Php posts offline code to wordpress and other websites that support xmlrpc. Last week, I made a Silver Soul website www.iyinhun.com. fans of popular animation can see it. I wanted to develop an automatic maintenance program because of my hard work.
Http://www.iyinhun.com
Fans of hot-blooded animations who like sputation can look at it.

I want to develop an automatic maintenance program (which is actually the meaning of the collector)
The following is the code for php to send articles to such websites (php will post offline code to wordpress, blogbus, cnblogs, and other websites that support xmlrpc)
You can change the category attribute (categories, mt_keywords) by yourself.
The attachment contains the wordpress xmlrpc class library.

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 ['category'] = array ("same person "); $ content ['description'] = $ con; // $ content ['m M _ Fields'] = array ('key' => 'My _ custom_fied ', 'value' => 'yes'); $ content ['Mt _ keyword'] = 'same user'; 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 ;}

Fans of the hot blood animation who love sp http://www.iyinhun.com can look at it. I want to create an automatic maintenance program (in fact...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.