Skip to content

Instantly share code, notes, and snippets.

@apsun
Created February 13, 2020 05:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apsun/95962a46d0bc30b9e3f9e9e9dd094bcd to your computer and use it in GitHub Desktop.
Save apsun/95962a46d0bc30b9e3f9e9e9dd094bcd to your computer and use it in GitHub Desktop.
#!/bin/sh
old=""
while :; do
new="$(curl -s 'https://www.apple.com/shop/retail/pickup-message?parts.0=MWP22AM%2FA&location=94043' | jq '.body.stores[:4][].partsAvailability["MWP22AM/A"] | select (.pickupDisplay == "available") | .storePickupQuote' -r | head -n1)"
if [ "$new" != "$old" ]; then
if [ "$new" != "" ]; then
notify-send 'AirPods' "$new"
fi
old="$new"
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment