Created
December 19, 2017 19:45
-
-
Save GeorgeErickson/4795c49b37a2a94b19db804025848db8 to your computer and use it in GitHub Desktop.
gf wants a sweater that is out of stock
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
#!/usr/bin/env bash | |
set -euE -o pipefail -o noclobber | |
lookup() { | |
local matches=$(wget -qO- "http://www.patagonia.com/on/demandware.store/Sites-patagonia-us-Site/en_US/Product-Variation?pid=25542&dwvar_25542_color=TUCV&dwvar_25542_size=M" | pup '.availability-msg > p.in-stock-msg' | wc -l) | |
echo "$matches" | |
if [ "$matches" -gt 0 ]; then | |
terminal-notifier -message "in stock" | |
fi | |
} | |
while : ; do | |
lookup | |
sleep 300 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment