Skip to content

Instantly share code, notes, and snippets.

@kudarap
Created October 12, 2022 01:38
Show Gist options
  • Save kudarap/6437f58abac8ac073f3cceff8707ec2c to your computer and use it in GitHub Desktop.
Save kudarap/6437f58abac8ac073f3cceff8707ec2c to your computer and use it in GitHub Desktop.
CULT OF THE LAMB MERCH watcher with ratatxt as alert
#!/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