More flexibility in Pushcut Webhook Payload

(I’m not sure whether to post this in Reddit, or here, or talk to @sliemeobn privately. So here goes…)

Let me start with a concrete example:

I would like GitHub on the creation of a new Issue to trigger a Pushcut Notification - that then results in an OmniFocus task being created. (The shortcut to do this works fine, extracting the issue number and title and a URL to the issue.)

Here’s the problem:

The webhook URL format that GitHub uses is not in the form Pushcut can use:

  • Yes, it has the secret.
  • Yes, it routes through PushCut.
  • No, the payload is not in a form PushCut can extract meaning from.

The payload is some JSON and there is no flexibility in its format. This is not the format PushCut needs.

My current solution - which works quite well - is to run a “protocol converter” on a Raspberry Pi. This is some Apache / PHP code I wrote for the purpose. It rewrites the JSON. But

  • It required me to expose my Pi to the web which most people won’t do.
  • It requires writing web server code which most people won’t do.
  • It adds an “always on” hardware requirement.

(My first stab at this used IFTTT’s GitHub integration - which is very unreliable. Hence my “build it myself” second stab.)

I emphasised “which most people won’t do” because this post is actually about widening the applicability of PushCut.

I’d like to discuss how PushCut might accept more flexible input - and hence be even more useful.

Thoughts?

what I can tell you with certainty is that that extending Pushcut in this direction is not on the roadmap at all.

now, what the best workaround might be is a different story…

Of course, if you can, doing code is always an option :wink: (and cloud hosting is really simple these days…) - but I think services like IFTTT, Zapier or Integromat should cover this type of task best for most people.

You could also run a Pushcut Automation Server, send the original JSON payload to a “converter shortcut” though the Pushcut API, and then use the Pushcut Shortcut actions to send modified or “pre-processed” notification as you want them.

1 Like

I totally understand your position. And I think you’re right.

The best way forward is to use an intermediary. I looked up iPod Touches - which I think @RosemaryOrchard said she was using. They are far more expensive than the Raspberry Pi solution I’ve written. (Even if there wasn’t a spare Pi the user could deploy.)

So, I think the best thing for me to do is to write up my solution on my blog.

The coding wasn’t difficult - once prereqs were in place. I happened to use Apache / PHP- as that’s something I’m familiar with. I’m less familiar with node.js and don’t intend to re-implement in it. But other automators might want to go that route. In any case the ideas are directly transferable and anyone wanting to share a node.js reworking would be doing the community a favour, I think.

So, the issue of matching web payloads from source (in my case GitHub) to destination (Shortcuts via PushCut) is a live one.

I don’t think it invalidates PushCut at all - and I don’t think the payload mismatch problem is significantly different if I were to use an iOS based Automation Server. The Pi is just significantly more flexible and cheaper.

Anyhow, for now I have a thoroughly reliable “GitHub Issue to Omnifocus Task” automation - via Pi and PushCut.

I’m using Integromat for this. It’s cheap and flexible, and doesn’t require me to run my own hardware open to the web. Of course, I already have VPSes and so on, but sometimes the no code option appeals :wink:

1 Like

Just to clarify, that’s my Pushcut server and a testing device.

1 Like

The issues here are when you can’t readily do the transformation, and when the service you’re using is unreliable. (GitHub->IFTTT is unreliable and I have no idea who is responsible so who should fix it). But I agree using a standard set of services is preferable.

Now, if Integromat had a really strong JSON and URL rewriting capability that would really help - but then it’s “almost programming” :slight_smile: to use it.

TBH the worst bit was setting up NAT for Port 80. And instructions for that are going to be specific to routers and, in my case, having to NAT through two routers - the ISP-supplied one and the stronger one I hung off it.

Right. I see you have a better use case - as it’s dual usage. When I priced this I was, of course, looking at the latest one (for software longevity) and at least 32GB. Reasonable design decisions but somewhat bumped the price up.

Still, I have 5 Pi’s, most of which are still looking for roles. :slight_smile:

I feel maybe we need a forum thread or area for those! :wink:

1 Like

I don’t think you’re entirely joking…

…We probably do need something for Pi / Arduino / similar. More generally “servers” or “other computing devices”. I think the remit should be bounded by “as they relate to automating Apple kit”.

What’s the case for limiting to “as they relate to automating Apple kit”? That’s surely a rather narrow niche for a non-Apple forum?

1 Like

None really. I just thought people would prefer it. I tagged this thread “Pushcut” because it directly related to a Pushcut capability, BTW. Otherwise I might well have tagged it differently.