Example of how to use node-wordpress Example of how to use node-wordpress wordpress wordpress

Example of how to use node-wordpress


I've managed to get it done by reading the module itself.

First you start the client:

var wp = wordpress.createClient({            "url": 'http://yourwordpressURL',             "username": 'user',             "password": 'pwd' });

than to add a post, for instance, just make the following call:

wp.newPost({      title: 'Your title',      status: 'publish', //'publish, draft...',      content: '<strong>This is the content</strong>',      author: 3, // author id      terms: {'category': [category_id]}    },    function() {       console.log(arguments);    }});

All the documentation for wordpress is in http://codex.wordpress.org/XML-RPC_WordPress_API/Posts

Hope that helps.