Support » Everything else WordPress » Getting started with xml-rpc or atom publising protocal

  • Hello,

    I’m trying to integrate my wordpress installation with my main site using a php script to publish pushed content into wordpress.

    This weekend I was playing around with xml-rpc, trying to figure it out, but from what I found, there doesn’t seem to be a lot of white papers or script examples for it.

    After enabeling xml-rpc in my wordpress blog, I was able to publish using a script I found:

    function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$categories=array(1)){
    $categories = implode(",", $categories);
    $XML = "<title>$title</title>".
    $params = array('','',$username,$password,$XML,1);
    $request = xmlrpc_encode_request('blogger.newPost',$params);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    curl_setopt($ch, CURLOPT_URL, $rpcurl);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1);

    This works great, but I’ve moved beyond what this script provides. I was hoping someone can tell me if the script above is even the right approach to publishing to wordpress using xml-rpc.

    If so, I can’t figure out a way to have pictures uploaded to the site using curl, or add tags, or even change a publishing date (to back date older content from my archive), if any of these are possible.

    Also, I was hoping someone might be able to share with me how atom publishing differs to xml-rpc, and if there are any advantages or disadvantages to one over the other.

    Thank you so much

Viewing 1 replies (of 1 total)
  • WordPress uses the PHP library IXR – – for XML-RPC, which includes a client portion. Using that will make things much easier for sending XML-RPC requests.

    The metaWeblog.* methods are well supported in WordPress, as well as a number of WordPress specific methods –

    XML-RPC compared to AtomPub, there are numerous differences. While they both use XML to encode the data shipped back and forth, the basic methods for exchanging data and actions are very different.

    Currently WordPress provides more features and capabilities via XML-RPC than AtomPub.

Viewing 1 replies (of 1 total)
  • The topic ‘Getting started with xml-rpc or atom publising protocal’ is closed to new replies.