views:

79

answers:

1

I am using the JoeBlogs .Net wordpress wrapper by Alex James Brown. It just essentially makes all of the XML RPC calls available to .Net.

I have been using the GetRecentPosts(5) call, e.g. "Grab the 5 most recent posts", but this returns everything from the entire blog.

What if I want to simply grab the latest posts within Category X?

E.g. I want GetRecentPosts("My Category", 5);

Is this possible with the current XML RPC API?

I really don't want to have to resort to pulling down 20 ALLRecentPosts and then sub-filtering by category, because that will be so inefficient, as I will have one site calling the blog site to fetch this data..

Many thanks.

A: 

I don't think there is a default XML-RPC method that does this. However, you can add new methods by hooking into Wordpress's xmlrpc_methods filter (see below), although presumably that would mean you'd also have to add some code to your .Net wrapper.

add_filter('xmlrpc_methods', 'add_xmlrpc_method');

function attach_new_xmlrpc($methods) {
    $methods['foo'] = 'bar';
    return $methods;
}

function bar($args) {
    // get and return posts
}
Richard M
Cheers Richard.
Aaron