Last active
December 10, 2015 14:38
-
-
Save peta/4448407 to your computer and use it in GitHub Desktop.
Cronjob der alle 30 Minuten die Verfügbarkeit der Google Nexus 10 Tablets im Google-Play-Store prüft und – wenn lieferbar – eine Benachrichtigungs-Mail an eine gegebene Adresse verschickt. `crontab isnexusinstock.cron`
This file contains hidden or 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
| */30 * * * * /path/to/your/isnexusinstock.sh |
This file contains hidden or 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 sh | |
| send_to='[email protected]' | |
| oos_str='<div class="hardware-small-print">Momentan nicht auf Lager. Bitte besuchen Sie uns bald wieder.</div>' | |
| check_avail() { | |
| curl -s "$2" | grep -F "$oos_str" >> /dev/null || { | |
| echo "Hier gehts zur Bestellseite: $2" | mail -s "Wieder lieferbar: $1" "$send_to" | |
| return 0 | |
| } | |
| return 1 | |
| } | |
| # Do the work | |
| check_avail 'Nexus 10 16GB' 'https://play.google.com/store/devices/details/Nexus_10_16GB?id=nexus_10_16gb' | |
| check_avail 'Nexus 10 32GB' 'https://play.google.com/store/devices/details?id=nexus_10_32gb' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment