1 wildduck Sep 20, 2008 18:37
3 adam Sep 26, 2008 16:30
Hi Wildduck (I think you've fixed your problem) Well done.
It seems you're using the XMLRPC function to add a blog (Atleast someone worked it out). Could you please provide me with a few hints as to how I can do this? I didnt consider actually just using the functions, I was looking for an actual RPC method to do post inserts.
Please show me a more clean version if you have the time.
Thanks!
4 wildduck Sep 26, 2008 16:39
Hi Adam,
This is my little test. I hope this can help you!
<?php
include("xmlrpc.inc");
$ee_api_path = "http://www.yoursite.com/blogs/xmlsrv/xmlrpc.php";
$ee_username = "nickname";
$ee_password = "password";
$c = new xmlrpc_client($ee_api_path);
$c->debug = true;
$content['title'] = "This is an auto-post";
$content['description'] = "This is the breaf<!--more-->More text with rendering objects [video:youtube:youtubeid]";
$content['categories'] = array("Category I", "Category II");
$content['tags'] = "tag1,tag2,tag3";
$x = new xmlrpcmsg("metaWeblog.newPost",
array(php_xmlrpc_encode("2"),
php_xmlrpc_encode($ee_username),
php_xmlrpc_encode($ee_password),
php_xmlrpc_encode($content),
php_xmlrpc_encode(true)));
$c->return_type = 'phpvals';
$r = $c->send($x);
if ($r->errno == "0") {
echo "Successfully Posted";
} else {
echo "There are some error";
print_r($r);
}
?>
5 adam Sep 26, 2008 16:52
Oh man... THANK YOU SO MUCH!
My cURL way of doing things was so wrong. MUCH THANKS!
Have fun with your future projects!
6 wildduck Sep 26, 2008 22:47
I hope this can help you a lot! :lol:
7 toskers Mar 25, 2010 20:14
Hi,
Your code doesn't seem to work for me. I am trying to make a blog post via XMLRPC.
My blog is at: http://my.domain.name/blog6.php
while the xmlrpc api is at: http://my.domain.name/xmlsrv/xmlrpc.php
How do I configure your code to work for me?
Your time and help is greatly appreciated. Thanks!
Hi Everyone,
I do a little modification. Now I can handle tags, too! I don't know if I made these chances on the correct files, but it working now! Just in case these are my diff: