Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How does MarsEdit post edited entries back to WordPress?

edited August 2011 in MarsEdit
Before I go and crank up the debug logging on my server to try and figure it out, I'm hoping someone (i.e., Daniel) can answer the following question:

How does MarsEdit post edited entries back to WordPress?

Specifically, what XML-RPC message is it using?

For the back-story as to why I'm asking, here's a blog post explaining what I'm trying to figure out:

In the meantime, I guess I'll start logging stuff to figure it out, but in case it's faster to ask ... well, I'm asking. ;-)



  • To answer my own question, it appears that MarsEdit does this:

    1. metaWeblog.editPost(postid, username, password, struct, publish = 0)
    2. mt.setPostCategories(postid, username, password, struct)
    3. metaWeblog.editPost(postid, username, password, struct, publish = 1)
    4. metaWeblog.getPost(postid, username, password)
    5. mt.getPostCategories(postid, username, password)

    At first glance, this all looks right. However, I'm speculating (and will confirm with actual debugging after I post this comment) that the following is happening: when MarsEdit pushes the edit in step #1 above with publish=0, this causes the WP plugin to remove the LJ post in order to "unpublish" it. Then, it re-posts it in step #3 with publish=1, but as a new post since the old post was deleted.

    Does this sound like a reasonable possibility? Time to go confirm ...
  • Crap. Right from within the WP plugin code:

    // This function will delete a post from LJ if it's changed from the published status


    Well, at least I know what's doing it, now. While I could certainly make a case for MarsEdit *not* editing the post twice, toggling the "publish" bit the way it does ... I suspect it'll just be easier for me to improve the WP plugin to not delete a post but instead mark it as "Just Me (Private)" if it's unpublished from within WP temporarily.

    Hopefully, this information I've collected will help some future poor soul who's facing the same issue.
  • Hi dossy - the MarsEdit behavior is a little "overkill" because it's a generic process that is intended to make publishing work with a wide variety of blog systems. Some systems need the coddling of moving things along with the publish "bit" as you noticed.

    At some point I might try to optimize the behavior of MarsEdit to only do the minimum required for WordPress, since it ultimately requires less API activity than MarsEdit currently does.

    In the future if you want to inspect what MarsEdit is doing, you can look at Window -> Network Log and get a good view of what it's sending and receiving.

  • Cool, thanks for the pointer to the Network Log - that's handy, especially if I didn't have the MITM proxy for inspecting HTTP traffic.
Sign In or Register to comment.