IFTTT & Raspberry pi: Assigning value from terminal to IFTTT web request
Expressions inside single quotes do not get expanded in the shell, they are taken as literal. That means, if you store your IP address in a variable called ip
like this:
ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
and you put that in single quotes, it won't get expanded:
echo '$ip'
$ip
whereas if you put it in double quotes, it will get expanded:
echo "$ip"
192.80.136.233
So, you need double quotes, but that will cause a problem because you need double quotes around your JSON strings, so you need to escape those by prefixing them with backslashes. So, you want:
curl -X POST -H "Content-Type: application/json" -d "{\"value1\":\"$ip\"}"
IFTTT Applet Creation with maker
Unfortunately, the short answer (as far as I know) is no. It is possible to create an applet where you can say "alexa, trigger preset abc" and then, using the Maker applet, have that send a web request to a server/REST API, which you could have configured to connect to multiple different services through your own code.
Related Topics
"Bad Interpreter" Error Message When Trying to Run Awk Executable
How to Properly Quote This Bash Pipeline for Watch
How to Start a Process That Won't End When My Ssh Session Ends
Shell Script Issue with Filenames Containing Spaces
Where Is $Path Set? Specifically Where Is My MAC Port Path Being Set
How to Merge Two Seperate - Yet Similar - Codebases into One Svn Rep
Installing Gnu Parallel Without Root Permission
Why Doesn't Linux Accept() Return Eintr
Curl Command Doesn't Work in Bash Script
Delete Files with Backslash in Linux
/Var/Log/Daemon.Log Taking More Space How to Reduce It
Determine Vm Size of Process Killed by Oom-Killer
R Package Installation in Linux
Rsync, 'Uid/Gid Impossible to Set' Cases Cause Future Hard Link Failure, How to Fix
I'm Having Difficulty Understanding the Shellshock Vulnerability Verification
Bash Script to Remove Directories Based on Modified File Date