I have a standard WordPress site running on Hostgator. I am trying to add a post from an external php application. I am using class.bloggerclient.php in conjunction with xmlrpc.php that comes with WordPress. Rather than adding a post as it should I am getting the following error: “XML-RPC server accepts POST requests only.”.
Does anyone have experience adding a post from an external application? Is there a better approach for doing this successfully?
********* Here is the php application code:
include_once(“class.bloggerclient.php”);
$username = “myusername”;
$password = “mypassword”;
$blog = new bloggerclient($username, $password);
$blogID = “12345”;
$testPost = “This is the post that I am trying to add!!”;
$publish = true;
$myPost = $blog->newPost($blogID, $textPost, $publish);
********* First few lines of the class.bloggerclient.php file:
require_once(“xmlrpc.php”);
class bloggerclient {
var $appID = “YOU MUST PLACE YOUR BLOGGER API KEY HERE”;
var $bServer = “mysite.com”;
var $bPath = “/xmlrpc.php”;
var $apiName = “blogger”;
var $blogClient;
var $XMLappID;
var $XMLusername;
var $XMLpassword;