But I could not find any documentation how to remotely
create new categories or posts.
Even with
Code: Select all
require_once 'XML/RPC.php';
$xml_entries_vals[] = new XML_RPC_Value("tbaumann", "string");
$xml_entries_vals[] = new XML_RPC_Value("p@ssw0rd", "string");
$xml_entries_vals[] = new XML_RPC_Value("AAAAA", "string");
$xml_entries_vals[] = new XML_RPC_Value("BBBBB", "string");
$msg = new XML_RPC_Message('blogger.getUserInfo', $xml_entries_vals);
$cli = new XML_RPC_Client('/serendipity_xmlrpc.php', 's9y.1-search.de');
$cli->setDebug(1);
$msg->createPayload();
$resp = $cli->send($msg);
if (!$resp) {
echo 'Communication error: ' . $cli->errstr;
exit;
}
if (!$resp->faultCode()) {
$val = $resp->value();
$data = XML_RPC_decode($val);
echo $data[0]['name'] . ' is at version ' . $data[0]['version'];
} else {
/*
* Display problems that have been gracefully cought and
* reported by the xmlrpc.php script
*/
echo 'Fault Code: ' . $resp->faultCode() . "\n";
echo 'Fault Reason: ' . $resp->faultString() . "\n";
}
When I log in normally to s9y with above username and password, I can login.
Can sb. help me ?
I just want to send an XML with CDATA containing the new Post and the
categories.
How can I add/list categories ?
How can I add posts?
I think we have to set up the variables
$xml_entries_vals[] correctly.
Thanks for any reply!
Thomas.