No matter where I look, I just can’t find a way to fully connect my app to WordPress. What I’d like to do is: show recent articles (published, of course) and older ones when you’re not logged in and facilitate writing comments for users that are.
It just looks like I have to pull the blog articles from RSS (but what about the text below ‘Read More…’?), and then use XML-RPC* to comment on the articles. Is that the way, or does anyone have a better solution? (*metaWeblog.getRecentPosts isn’t always available on WP)
I don’t have a lot to say about the implementation of the blog in question, though I could ask the owner to install some plugins. Such as WP-RESTful.
Please point me in the right direction to look, because I’ve spent days searching for a solution that should be simple but just doesn’t seem to be that way. Thanks!
The WordPress mobile team has a repository for the XML-RPC parser they use. It’s fairly simple to implement and use. It consists of a
XMLRPCDecode
andXMLRPCEncoder
.https://github.com/wordpress-mobile/wpxmlrpc
EDIT
XML-RPC
in WordPress is intended for posting. The functionalities for getting posts are quite limited because the WordPress implementation useswp_get_recent_posts()
in thewp.getPosts
method. I made the function better by adopting thewp_getPosts
method inclass-wp-xmlrpc-server.php
and replacingwp_get_recent_posts
byget_posts
. So I can use all parameters like inWp_Query
class.The
xmlrpc_method
filter is then used to override the built in methods. I could post the code, if you want.EDIT II
Nevermind, I’ll post the code… 🙂
I think xmlrpc is the way to go, that’s the way WP’s own app connects for instance. Why don’t you use it to get the posts as well, why use RSS for that?