Created
October 29, 2013 21:58
-
-
Save e-minguez/7223387 to your computer and use it in GitHub Desktop.
Simple script to check the availability of the new nexus 5. Credit goest to @poliva (https://github.com/poliva/)
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
#!/bin/sh | |
URL="https://play.google.com/store/devices/details?id=" | |
MODELS="nexus_5_16gb nexus_5_black_16gb nexus_5_white_16gb nexus_5_32gb nexus_5_black_32gb nexus_5_white_32gb" | |
TMPDIR="/home/myself/nexus5" | |
MAILS="some@email another@mail" | |
for model in ${MODELS} | |
do | |
OLD=${TMPDIR}/${model}_old | |
NEW=${TMPDIR}/${model}_new | |
/usr/bin/curl -s "${URL}${model}" -o ${NEW} | |
if [ $(diff ${OLD} ${NEW}|wc -l) != 0 ] | |
then | |
for mail in ${MAILS} | |
do | |
echo "Nexus 5 available in ${URL}${model}" | mail -s "Nexus 5" $mail | |
done | |
fi | |
mv ${NEW} ${OLD} | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment