Last active
December 1, 2017 16:24
-
-
Save HokieGeek/b7fd3dbe011a47df9f8f09dee43044ea to your computer and use it in GitHub Desktop.
IFTTT Maker Channel Bash Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
(( $# <= 0 )) && exit 1 | |
key=REPLACE_ME | |
read event values <<<$(echo -n "$@" | awk 'NR > 1 { $0=sprintf("\"value%d\":\"%s\",", NR-1, $0) } 1' RS=' ' ORS=' ' | sed 's/, $//') | |
curl --request POST \ | |
--header 'Content-Type: application/json' \ | |
--data '{'"${values}"'}' \ | |
https://maker.ifttt.com/trigger/${event}/with/key/${key} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or