Send Mela recipe to webhook

We use Mela as our shared family cookbook. I wanted a way to send recipes to a digital screen in the kitchen, but the screen is an Android tablet and Mela is iOS only.

After some research I realised that .melarecipes files are just structured JSON. Half an hour later with iOS Shortcuts I had a workflow that would POST that JSON to a HTTP endpoint and display it on the screen. Here's the workflow:

You can install the shortcut via iCloud.

If the iCloud link isn't working for you, save the XML below as mela.txt:

View Shortcut XML
xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WFQuickActionSurfaces</key>
<array/>
<key>WFWorkflowActions</key>
<array>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.filter.files</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>UUID</key>
<string>2D394DAA-30A9-4669-96CB-A5361678B334</string>
<key>WFContentItemFilter</key>
<dict>
<key>Value</key>
<dict>
<key>WFActionParameterFilterPrefix</key>
<integer>1</integer>
<key>WFActionParameterFilterTemplates</key>
<array>
<dict>
<key>Operator</key>
<integer>4</integer>
<key>Property</key>
<string>File Extension</string>
<key>Removable</key>
<true/>
<key>Values</key>
<dict>
<key>String</key>
<string>melarecipe</string>
<key>Unit</key>
<integer>4</integer>
</dict>
</dict>
</array>
<key>WFContentPredicateBoundedDate</key>
<false/>
</dict>
<key>WFSerializationType</key>
<string>WFContentPredicateTableTemplate</string>
</dict>
<key>WFContentItemInputParameter</key>
<dict>
<key>Value</key>
<dict>
<key>Type</key>
<string>ExtensionInput</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenAttachment</string>
</dict>
</dict>
</dict>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.setitemname</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>UUID</key>
<string>13467024-C2E7-4FBB-B6D1-3B997CB93B21</string>
<key>WFDontIncludeFileExtension</key>
<true/>
<key>WFInput</key>
<dict>
<key>Value</key>
<dict>
<key>OutputName</key>
<string>Files</string>
<key>OutputUUID</key>
<string>2D394DAA-30A9-4669-96CB-A5361678B334</string>
<key>Type</key>
<string>ActionOutput</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenAttachment</string>
</dict>
<key>WFName</key>
<string>recipe.txt</string>
</dict>
</dict>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.detect.text</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>UUID</key>
<string>58DC0AC5-ADB5-4636-883C-96DE0563CC27</string>
<key>WFInput</key>
<dict>
<key>Value</key>
<dict>
<key>OutputName</key>
<string>Renamed Item</string>
<key>OutputUUID</key>
<string>13467024-C2E7-4FBB-B6D1-3B997CB93B21</string>
<key>Type</key>
<string>ActionOutput</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenAttachment</string>
</dict>
</dict>
</dict>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.setvariable</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>WFInput</key>
<dict>
<key>Value</key>
<dict>
<key>OutputName</key>
<string>Text</string>
<key>OutputUUID</key>
<string>58DC0AC5-ADB5-4636-883C-96DE0563CC27</string>
<key>Type</key>
<string>ActionOutput</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenAttachment</string>
</dict>
<key>WFVariableName</key>
<string>recipe</string>
</dict>
</dict>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.url</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>UUID</key>
<string>61209839-1756-44E6-AB67-8B37C59A738F</string>
<key>WFURLActionURL</key>
<string>http://example.com:9876/mela</string>
</dict>
</dict>
<dict>
<key>WFWorkflowActionIdentifier</key>
<string>is.workflow.actions.downloadurl</string>
<key>WFWorkflowActionParameters</key>
<dict>
<key>ShowHeaders</key>
<true/>
<key>UUID</key>
<string>269D8007-2CD3-4A3E-A951-9C21E89D5FDC</string>
<key>WFHTTPBodyType</key>
<string>File</string>
<key>WFHTTPHeaders</key>
<dict>
<key>Value</key>
<dict>
<key>WFDictionaryFieldValueItems</key>
<array>
<dict>
<key>WFItemType</key>
<integer>0</integer>
<key>WFKey</key>
<dict>
<key>Value</key>
<dict>
<key>string</key>
<string>Content-Type</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenString</string>
</dict>
<key>WFValue</key>
<dict>
<key>Value</key>
<dict>
<key>string</key>
<string>application/json</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenString</string>
</dict>
</dict>
</array>
</dict>
<key>WFSerializationType</key>
<string>WFDictionaryFieldValue</string>
</dict>
<key>WFHTTPMethod</key>
<string>POST</string>
<key>WFRequestVariable</key>
<dict>
<key>Value</key>
<dict>
<key>Type</key>
<string>Variable</string>
<key>VariableName</key>
<string>recipe</string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenAttachment</string>
</dict>
<key>WFURL</key>
<dict>
<key>Value</key>
<dict>
<key>attachmentsByRange</key>
<dict>
<key>{0, 1}</key>
<dict>
<key>OutputName</key>
<string>URL</string>
<key>OutputUUID</key>
<string>61209839-1756-44E6-AB67-8B37C59A738F</string>
<key>Type</key>
<string>ActionOutput</string>
</dict>
</dict>
<key>string</key>
<string></string>
</dict>
<key>WFSerializationType</key>
<string>WFTextTokenString</string>
</dict>
</dict>
</dict>
</array>
<key>WFWorkflowClientVersion</key>
<string>4711</string>
<key>WFWorkflowHasOutputFallback</key>
<false/>
<key>WFWorkflowHasShortcutInputVariables</key>
<true/>
<key>WFWorkflowIcon</key>
<dict>
<key>WFWorkflowIconGlyphNumber</key>
<integer>61440</integer>
<key>WFWorkflowIconStartColor</key>
<integer>-615917313</integer>
</dict>
<key>WFWorkflowImportQuestions</key>
<array/>
<key>WFWorkflowInputContentItemClasses</key>
<array>
<string>WFAppContentItem</string>
<string>WFGenericFileContentItem</string>
</array>
<key>WFWorkflowMinimumClientVersion</key>
<integer>1113</integer>
<key>WFWorkflowMinimumClientVersionString</key>
<string>1113</string>
<key>WFWorkflowNoInputBehavior</key>
<dict>
<key>Name</key>
<string>WFWorkflowNoInputBehaviorShowError</string>
<key>Parameters</key>
<dict>
<key>Error</key>
<string>No Input Found</string>
</dict>
</dict>
<key>WFWorkflowOutputContentItemClasses</key>
<array/>
<key>WFWorkflowTypes</key>
<array>
<string>QuickActions</string>
<string>Watch</string>
<string>ActionExtension</string>
<string>WFWorkflowTypeShowInSearch</string>
</array>
</dict>
</plist>

Next, run the following commands:

bash
plutil -convert binary1 mela.txt -o unsigned.shortcut
shortcuts sign --mode anyone --input unsigned.shortcut --output Mela.shortcut

Then double click Mela.shortcut.