Workflow

From IndieWeb
Jump to: navigation, search


Workflow is an iOS app 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 Workflow to post photo's to his site, and then POSSE them to his Instagram.

His workflow is as follows. Note that most of the bulletpoints, once set, run automatically. You need to obtain an Access Token to your Micropub Endpoint, or steal one from a Micropub client you already use.

In the native Photos app, choose a picture to post, then open the share menu and run the following Workflow:

A Workflow called 'Foto op Seblog' which accepts images:

  • Set variable {photo} (I will use this bracket notation for vars here)
  • Ask for input: caption?
  • Copy to clipboard (so you can add it to Instagram later)
  • Set variable {caption}
  • URL (point this one to your Micropub endpoint)
  • Get contents of URL > advanced
    • Method: POST
    • Headers: Authorization: bearer [token] (put your token here)
    • Request body: (Form)
      • h: entry (just that text)
      • photo: {photo} (this one as 'file', select the variable)
      • content: {content} (select the variable)
  • Get URLs from Input - this is a tricky one. I let my Micropub endpoint return a body with '<a href="new-post-url">Success</a>' in order for this to work
  • Open URLs (now you're redirected to Safari, opening your new post manually go back to the Photos app now, then Workflow starts again)
  • Choose from menu: 'Also post on Instagram?' > Yes > Cancel
    • on yes:
      • Get variable {photo}
      • Post on Instagram (I have caption set to var Content, but that doesn't seem to work always)

Then, on Instagram, just click through the menu's. When asked for the caption, if it's not there, you can just paste from your clipboard, the caption should be there.

After posting copy the URL of the Instagram-post to your clipboard.

Go back to Safari, where your new post is still lurking, open Share menu and choose the following workflow 'Save syndication', which takes URLs and Safari web pages:

  • Get URLs from Input
  • Set variable {entryurl}
  • Ask for input: What is the Instagram url? > default answer {clipboard} > input type URL (you can leave this step out and just grab the clipboard, but I like checking)
  • Set variable {insta}
  • URL (set this to be your Micropub endpoint)
  • Get contents of URL > Advanced
    • Method: POST
    • Headers: Authorization: bearer [token] (put your token here)
    • Request body: (JSON!)
      • action: update
      • url: {entryurl}
      • (as dictionary) add:
        • (as array) syndication:
          • {insta}
  • Get var {entryurl}
  • Open URLs

And there you have it!

Micropub Media Endpoint

media-endpoint-workflow-settings.png
media-endpoint-workflow-details.png

Create a new workflow

  • Accepts: Images, Media
  • What type of workflow? 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: Workflow magic variable, choose "Workflow Input"
  • Show Notification: Contents of URL (This will display the response from your media endpoint so you can confirm the upload worked)

See Also

Personal tools
Namespaces
Variants
Actions
Recent & Upcoming
Resources
Toolbox