Shortcuts

From IndieWeb
(Redirected from Shortcut)


Shortcuts is an iOS app formerly known as Workflow used to automate various actions. With the advanced "Get contents of URL" action it can be used to make Micropub requests or upload files to a media endpoint.

Instagram POSSE

Sebastiaan Andeweg uses Shortcuts to post photo's to his site, and then POSSE them to his Instagram.

A desciption of the (old) flow can be found at Shortcuts/Instagram POSSE

A new, pre-build version can be downloaded. This one makes use of a few other flows. After import, you can customize to your needs.

Note: currently Shortcuts is not able to parse the Location header out of the Micropub request. This means it cannot show you your new post, unless your Micropub endpoint returns the link also in the body. This is non standard, but the Shortcut will detect it and show you your post if it can. If you see your post and want to POSSE to Instagram after it, just return to the Shortcuts app.

IndieAuth

Sebastiaan Andeweg made a Shortcut that does the IndieAuth dance for you, in order to pick up a token. It can be embedded into Micropub workflows, as it returns the token.

The current version required one weird copy-paste step, because iOS is not able to parse attributes after a redirect to the Shortcut app.

You can download the Shortcut here.

Micropub Media Endpoint

Pre-Built Shortcut

You can download a pre-built Shortcut that allows you to upload files to your media endpoint using the Share Sheet, or if the Shortcut is activated outside the share sheet it will present an option to upload from your Photos library or from the Files app.

You can download the Shortcut here

Creating Your Own Custom Shortcut

Create a new shortcut

  • Accepts: Images, Media
  • What type of shortcut? Action Extension

add the following items:

  • URL: Set the URL to your media endpoint
  • Get Contents of URL: Advanced
    • Method: POST
    • Headers: Authorization: Bearer XXXX (insert a Micropub access token)
    • Request Body: Form
      • file: Shortcut magic variable, choose "Shortcut Input"
  • Show Notification: Contents of URL (This will display the response from your media endpoint so you can confirm the upload worked)

See Also