Created
October 12, 2022 01:38
-
-
Save kudarap/6437f58abac8ac073f3cceff8707ec2c to your computer and use it in GitHub Desktop.
CULT OF THE LAMB MERCH watcher with ratatxt as alert
This file contains 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 | |
watchlist=/opt/scripts/watch-cult-merch.txt | |
sendAlert() { | |
echo "STOCKED! sending sms alert" | |
curl https://api.dev.ratatxt.com/outbox \ | |
-u 'ak_somekeys:' \ | |
-X POST -d '{ | |
"device_id": "c2fslnn0eqtq26rmcn2g", | |
"address": "09353700003", | |
"text": "CULT OF THE LAMB MERCH RESTOCKED!" | |
}' | |
} | |
checkStock() { | |
o=$(curl -s $1 | grep 'add-to-cart disabled') | |
if [ -z "$o" ]; | |
then | |
sendAlert | |
fi | |
} | |
while read p; do | |
checkStock $p | |
done <$watchlist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment