61°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • A MetaWeblog to Micropub Gateway

    April 9, 2018

    I’m always looking for fun and better ways to publish content to my website. There are several nice writing apps now, such as Byword for MacOS, which lets you write in Markdown and then converts it into HTML. Many of these kinds of apps have an option to publish to a Wordpress site, using Wordpress’ XML-RPC interface, which is more or less the MetaWeblog API.

    I thought it would be a fun experiment to try to set up my website to handle those XML-RPC calls so that I can use these apps, at least until they support Micropub natively.

    Problems with XML-RPC

    As with most XML formats, XML-RPC is ridiculously verbose for what it’s doing. In order to send a single string value, it requires wrapping it in a surprising amount of XML:

    <param>
    <value><string>aaronparecki.com</string></value>
    </param>
    

    The MetaWeblog API also requires that you give apps your Wordpress password, which has been a known anti-pattern for a long time. With things like OAuth, we have better ways of authenticating against APIs without sending passwords around.

    Micropub Bridge

    To avoid needing to add actual XML-RPC support to my website, I set up a bridge that translates XML-RPC calls to their equivalent Micropub calls. The bridge also obtains an IndieAuth access token so that I can use a token instead of entering my password into these apps.

    I didn’t bother adding any styling to the gateway since it’s something you’d only interact with once to set up, so apologies for the ugly screenshots that follow.

    Here’s what it looks like to connect Byword to be able to publish to my website.

    First I visit the gateway and log in.

    That does the IndieAuth discovery and takes me to my website where I grant it access.

    Then I’m redirected back to the gateway which provides instructions on what to do next.

    The key to making Byword find the XML-RPC API is adding that EditURI tag to my website. Then I can go into Byword and add a new Wordpress site, entering my domain name.

    It then asks for my username and password, which I enter by copying from the gateway.

    Then Byword is all set and thinks it’s talking to a Wordpress site!

    Now when I’m ready to publish this post, I click the “Publish” button in Byword, and fill in the title and tags.

    Open Source

    If you’d like to try this out, head to xmlrpc.p3k.io and connect your website!

    The source code is available on GitHub.

    I’ve only implemented the one newPost method that Byword uses when talking to the XML-RPC API. I’ve only tested this with Byword, so it’s very likely that other apps might be expecting more of the API to be implemented. Feel free to file issues if you have trouble using other apps! Eventually I’d like to implement more of the MetaWeblog API in this gateway, even if I really don’t like writing XML-RPC code!

    Portland, Oregon • 47°F
    Mon, Apr 9, 2018 9:12am -07:00 #micropub #indieweb #xmlrpc #metaweblog
    8 likes 1 repost 4 replies
    • Michael Runcieman
    • Aaron Parecki
    • Daniel Goldsmith
    • Grant Richmond
    • Marty McGuire
    • Alan S.
    • gRegor Morrill
    • Eddie Hinkle
    • Jonathan LaCour
    • Stephen Pieper stephenpieper.net
      A MetaWeblog to Micropub Gateway by Aaron Parecki (Aaron Parecki)
      I’m always looking for fun and better ways to publish content to my website. There are several nice writing apps now, such as Byword for MacOS, which lets you write in Markdown and then converts it into HTML. Many of these kinds of apps have an option to publish to a Wordpress site, using Wordpres...

      I would love to see Ulysses connected with this.

      Wed, Apr 11, 2018 12:01am +01:00
    • Ryan Barrett snarfed.org
      bridge all the things!
      Mon, Apr 9, 2018 4:34pm -07:00
    • dgold micro.blog/dgold

      @aaronpk Wow! That's an incredible thing to put out there & available, aaron, thank you.

      Sun, Mar 25, 2018 11:05am -07:00
    • Eddie Hinkle eddiehinkle.com

      This is great! I’m gonna have to try it out with Ulysses!

      Mon, Apr 9, 2018 1:37pm -07:00
Posted in /articles using xmlrpc.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv