Support » Fixing WordPress » To XML-RPC or not to XML-RPC, that’s the question

  • epologee

    (@epologee)


    Hi forum,

    I’m working on something I was planning for a long time. I’m creating a full screen Flash theme for WordPress, combined with an easy to use ActionScript library to get the right kind of data out of WordPress. In my quest to find the best way to get data out of WordPress and into Flash, without re-inventing the wheel, I’m now examining the XML-RPC connector.

    I’m running through all supported methods in the API list (by calling system.listMethods) to see what I can get from them. They’re also in xmlrpc.php, I’m using WP version 2.8.5.

    There are three findings that strike me as odd, and I would very much like an educated opinion on them. I have the feeling I’m on a very wrong path here.

    1. Firstly, all of the methods need a user/password combination, even the ones I would consider to be “read only”. I just want to read the pages, categories, posts and comments, although maybe comments could be added later. To workaround this restriction I added a subscriber user to WordPress. I couldn’t care less if someone checks the posts for a subscriber role’s user/password.
    2. Secondly, even with a subscriber account, most of the methods ask for current_user_can(‘edit_posts’), something a subscriber can’t do of course. Even wp.getPages, wp.getCategories and blogger.getPost. Why is this? Is the XML-RPC connector only meant to be used for “write only” access, not “read or write” access?
    3. And finally, I was checking out a method called wp.getPageList, only to find out that the corresponding class method “wp_getPageList” does not exist! Try it out yourself! Is the XML-RPC a work-in-progress thing? Or am I so cross-eyed that I’m looking at the wrong code?

    Or maybe I’m looking at the XML-RPC connector for the wrong kind of use all together, barking up the wrong tree so to speak?

    Is there a better way to get raw, read-only content out of WordPress to use in a non-browser client like Flash?

    I’d be much obliged for a little nudge in the right direction,
    Eric-Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • Joseph Scott

    (@josephscott)

    If you are looking for a read only method for collecting data the RSS/Atom feeds may fit better.

    The XML-RPC methods require authentication because they can read data that isn’t public yet as well.

    In -trunk the wp_getPageList function is defined in xmlrpc.php line 777.

    brasofilo

    (@brasofilo)

    hi there, using AMFPHP you can connect directly to the DataBase.

    using a hook you can call direct WordPress functions, i.e. get_post()
    – some functions don’t work, but many do
    – and you can do your own queries to the database as well

    here’s a sample script, note that i’m using AMFPHP 1.9 sintax (it’s less documented, but it’s faster than 1.2)

    here’s a project that deals with this question too (although i prefer a simpler aproach)
    this is the author

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘To XML-RPC or not to XML-RPC, that’s the question’ is closed to new replies.