Skip to main content
 

Micropub via iOS Shortcuts

3 min read

Inspired by this post by Jason Snell on Six Colors, I've managed to create a few different shortcuts that allow me to post to my WithKnown instance through the micropub endpoint.

I've created 5 different shortcuts:

  1. Post to blog
  2. Share link to blog
  3. Share link post to blog
  4. Post photo to blog
  5. Check-in

Post to Blog

The first one allows me to just create a blog post, either a status update or an article depending on the contents of the post. It takes a markdown file, or markdown text as input, converts it to HTML and posts it to my micropub endpoint. If the markdown contains a heading, then it makes that the title of the post, otherwise it just creates a status update post with no title. This is really great, because it allows me to use any text editor I want, I'm not confined to using something that has shortcuts integration or any other special features.

Share Link to Blog

This one just lets me share a link, without any commentary. This shortcut isn't very interesting, it just gets the title of the website and the URL and creates a bookmark post through the micropub endpoint.

Share Link Post to Blog

This shortcut allows me to share a link with commentary. It is almost a combination of the first and second shortcuts. It takes the URL passed to it, gets the title of the article as well as any selected text. It then creates a markdown file with the URL at the top, the title as a heading and the selected text as a pull quote. I can then add any comments I want and share the post to my blog. This creates a bookmark post with an optional pull quote and comment.

Post Photo to Blog

With this one I can post a photo to my blog. The post can be done with or without commentary. Optionally, I can share the photo to Instagram as well with a caption.

Check-in

This one was the most difficult to create. I used ownyourswarm to determine the JSON required to create a checkin post on Known. When creating this shortcut I came up with two different ways that it could be implemented. I could either base the check-in on the Current Location, or I could base it on a Location from Apple Maps and triggering the shortcut through the share sheet. I opted for the second approach, through the share sheet from Apple Maps. The reason I did this is because I often forget to check-in somewhere and don't remember until I've already left the location. By doing it through Apple Maps, my current location isn't important.

I may make some modifications to this shortcut in the future, maybe an option to use the current location or choose somewhere from Apple Maps, but I'm going to use this for now to determine if it meets my needs.

Overall I really like these shortcuts. They make it easier to post things to my blog, which previously wasn't all that easy, especially from mobile devices. Now though, I suspect I'll be posting more often.