metaWeblog.newPost :
PHP :
function wpBlog_newPost($content) {
global $blog;
$c = new xmlrpc_client($blog["Host"]."xmlrpc.php");
$c->setDebug(0);
$x = new xmlrpcmsg("metaWeblog.newPost",
array(php_xmlrpc_encode("1"),
php_xmlrpc_encode($blog["Username"]), // config.php
php_xmlrpc_encode($blog["Password"]),
php_xmlrpc_encode($content),
php_xmlrpc_encode(true)));
$c->return_type = 'phpvals';
$r =$c->send($x);
if ($r->errno=="0"){
//
$x = new xmlrpcmsg("metaWeblog.getPost",
array(php_xmlrpc_encode($r->value()),
php_xmlrpc_encode($blog["Username"]), // config.php
php_xmlrpc_encode($blog["Password"]) ));
$c->return_type = 'phpvals';
$r =$c->send($x);
$return_values = $r->value();
echo "<p><br><font color=green>Successfully Posted <a href=\"".$return_values['link']."\">".$blog["Host"]."</a><br><br></font></p>";
}else {
echo "<p><br><font color=red>There are some error<br><br></font></p>";
//print_r($r);
$return_values = $r->value();
}
return $return_values;
}