Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Created October 29, 2013 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e-minguez/7223387 to your computer and use it in GitHub Desktop.
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/)
#!/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