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

Source: Internet
Author: User

Last week, I made a ghost website.
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 ;}

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.