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...