Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.