Site icon Random Thoughts

Posting to WordPress from Emacs

I’ve grown increasingly annoyed (I annoy easily) with the HTML editor at WordPress.com. Not that the HTML editor at Blogger was any better. Editing blog entries is just fiddly when you have images and stuff.

And you have to upload the images. Boooring.

WordPress has a “post by email” feature, so I wondered what would happen if I sent a multipart/related HTML message, with images embedded in the email. The documentation didn’t say anything about this, so I thought the likelihood of them being nerdy enough to handle that was slim.

But look:

That’s the view from the hotel room in London… And this?

That’s Salt Lake City.

See? It works!

Now, Emacs didn’t support sending multipart/related messages, so I had to implement that first. In Ma Gnus now, if you compose an HTML message, and include <img> things that point to local files, then Message/mml will now rewrite the HTML to have internal cid: links, and append the images to the email. So you just send out huge emails, WordPress parses it, and this is the result.

Behold! The first resulting blog message!

Now to see whether I can control all relevant bits about how the images are placed and stuff…

Exit mobile version