I’ll explain now in a few steps, how to write a simple php script,
that can communicate and exchange data with a WordPress based site, that has XML-RPC support enabled.
First, we need the IXR client library (The Incutio XML-RPC Library for PHP),
which is actually bundeled with every WordPress installation, and located in the wp-includes/class-IXR.php file.

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;}

?>

The first question that would came to your mind once you’ve really tasted the xmlrpc thing, “How could I extend this?”. Well, there’s a simply way to extend this, like anything around WordPress, it can be done, with hooks.

For example create a my-xmlrpc.php in wp-content/plugins with this content: