Originally seen on mooey5775.
Sometimes, you get too lazy to actually script triggers and actions for all the little things that you want done in your digital life. It gets too annoying when you’re writing the same code over and over again for similar actions. There must be a better way.
I first discovered IFTTT (If This Then That) a few years ago. It’s an internet of things service (that can be used for other things too). After you sign up, you can create recipes which consist of a trigger and an action. These range through many different categories (channels), from email to Instagram, Hue, OpenHAB, etc. It seemed like the perfect solution for all of my scripting woes, but there was one small problem. I couldn’t actually trigger it from my projects. Sure I could set up a shady email system, but who wants do do that?
The Maker Channel logo. Colorful.
Thankfully, I discovered the Maker Channel, IFTTT’s solution to this MAJOR problem. When connecting this channel to IFTTT, IFTTT gives you a key. You can trigger recipes based on this channel RESTfully. Just make a GET or POST request to this URL once connected:
https://maker.ifttt.com/trigger/{event}/with/key/{key}
And your action will magically happen. Let’s test it! I’ve created an action with the Maker Channel trigger, which will then send me an email. The beauty of IFTTT is that it’s easy to trigger anything, and everything is quickly swappable.
Now it’s time to test it. An easy and quick way to send POST requests is through curl. The generic command to run is this:
curl -X POST https://maker.ifttt.com/trigger/{event}/with/key/{key}
My event is named “test”, so I would put that in the event part of the URL. My key is: ███████████████, so that’ll go into the key part of the URL. Let’s run the command.
And, almost immediately, an email!
Well, it works!
This can obviously be extended to many different applications. I hope you’re happy that you don’t have to script those long, tedious scripts ever again. Hopefully.