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>".
"<category>$categories</category>".
$body;
$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);
curl_exec($ch);
curl_close($ch);
}
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