Forked from arturoherrero/nexus-availability.sh
Last active
December 12, 2015 03:58
-
-
Save avances123/4710991 to your computer and use it in GitHub Desktop.
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 | |
# Check the availability of Nexus X devices. | |
# | |
# Install wget from Homebrew: | |
# $ brew install wget | |
# | |
# Setup OS X Mountain Lion to send mails from Terminal: | |
# $ sudo mkdir -p /Library/Server/Mail/Data/spool | |
# $ sudo /usr/sbin/postfix start | |
# | |
# Edit crontab to run this script every 30 minutes: | |
# $ crontab -e | |
# 0,30 * * * * /path/to/script/nexus-availability.sh | |
# | |
# Create a filter in gmail for your local email account: | |
# 'Never send it to Spam' | |
nexus4=https://play.google.com/store/devices/details?id=nexus_4_16gb | |
nexus7=https://play.google.com/store/devices/details?id=nexus_7_32gb | |
model=$nexus4 | |
outOfStock=$(wget -qO- $model | grep -Eio 'AGOTADO|SIN STOCK') | |
if [ "$outOfStock" == "" ]; then | |
echo "Hay stock de Nexus, entra a comprarlo ya: $model" | | |
mail -s "Hay stock de Nexus" [email protected] | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment