Shortcuts
This article is a stub. You can help the IndieWeb wiki by expanding it.
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.
- The Location as Geo URI Shortcut for location: https://www.icloud.com/shortcuts/f88b056be79946699aa351d26efb348b
- The Fetch Micropub endpoint Shortcut for the endpoint: https://www.icloud.com/shortcuts/efeae51596784fb7844791d7159d642a
- The IndieAuth Shortcut for authentication: see below.
- The Post Photo Shortcut itself: https://www.icloud.com/shortcuts/fbdebaac81ae4de69cb623f7fbfa8bed
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
- Template for the Photo to Micropub and Instagram shortcut
- Template for the Save Syndication shortcut
- https://workflow.is
- Warning against running Shortcuts from unknown people, at least one malicious Shortcut exists. Shortcuts has access to loads of highly persona information.
- A proof-of-concept was released 2019-01-30, the Twitter thread contains some more information about what information could be accessed.
- The issue was patched in Shortcuts 2.1.3, released 2019-02-07. The CVEs do not seem to be public (yet) but from the Twitter thread it looks like Shortcuts wasnβt correctly sandboxed and was able to access internal databases used by iOS.
- 2019/Amsterdam/shortcuts
- How to make a custom icon for any iOS app https://icons.tr.af/how