July 26, 2018

Siri Shortcuts - Episode 7

Shortcut Name: Photo Upload to hosted Micro.blog / Retrieve URL
Revision: 1.0
Add to Shortcuts!

What does it do?
This Shortcut lets you select a photo from your library and upload it to your hosted micro.blog media repository, and retrieve a link to that photo so that you can use it on your micro.blog hosted pages without the need to link out to external storage.

How does it work?

  1. Ask user to select a photo from their photo library.
  2. Converts the photo highest quality .jpg. (this mitigates any issues if the photo is .HEIC)
  3. It now posts the converted photo to the https://micro.blog/micropub/media endpoint.
  4. The response from the server is received as text.
    Example: {“url”:”http:\/\/www.burk.io\/uploads\/2018\/151f65c6fc.jpg”}
  5. Regex is used \B:|[{}”\\]|url to remove unnecessary characters, leaving you with a standard URL.
  6. Finally the cleaned up URL is copied to the clipboard.

Source Code”
Shortcut Code Screenshot

Check out other shortcuts!

iOS Shortcuts Siri

Previous post
Siri Shortcuts - Episode 6 Shortcut Name: Happy Level Tip Calculator Revision: 1.0 Add to Shortcuts! What does it do? This Shortcut is a handy tip calculator that allows you
Next post
Micro.blog Archives With the recent addition of the “Archives” feature, there is now a simple way to see a chronological flow of all posts made to your timeline. The
Jason Burk | 1999-2022
blot.im! | 🧛‍♂️
📦 Blog Archives 📦