Skip to content

Instantly share code, notes, and snippets.

@anpefi
Created June 23, 2015 10:16
Show Gist options
  • Save anpefi/36ff2edb153b68b97c3e to your computer and use it in GitHub Desktop.
Save anpefi/36ff2edb153b68b97c3e to your computer and use it in GitHub Desktop.
This is a generic script to send a web request to the maker channel in IFTTT.com in order to trigger an event in any other channel of IFTTT. It requires that Maker channel is activated in your IFTTT acocunt and having at least one recipe using the Event_name as trigger.
#!/bin/sh
# Script to send web request to MAKER channel in IFTTT.com.
# Arguments:
# $1: Event_name (this is the trigger for IFTTT and SHOULD BE configured in a IFTTT recipe in advance)) i.e: cluster_job
# $2: value1 (To be parsed as Maker variable, and be usable in the triggered event) OPTIONAL
# $3: value2
# $4: value3
# EXAMPLE
# Using recipe https://ifttt.com/recipes/301964 If Maker Event "mailto", then send an email to "value1" with subject "value2" and body "value3"
# ifttt.sh mailto JohnDoe@mail.com "These are the results" "$(cat results.txt)"
KEY=dGH789FGRD78FfH7JOkkbc #FAKE KEY. CHANGE IT to your own key provided by the Maker Channel in IFTTT
curl -X POST -H "Content-Type: application/json" -d '{"value1":"'"${2}"'","value2":"'"${3}"'","value3":"'"${4}"'"}' https://maker.ifttt.com/trigger/${1}/with/key/${KEY}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment