-
-
Save joeykrim/fc0dd9f25dd4cfe55438 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
#!/bin/bash | |
URL="https://play.google.com/store/devices/details?id=nexus_5_32gb" | |
EMAIL="youremail@example.com" | |
mkdir -p /tmp/googleplay/ | |
rm /tmp/googleplay/after 2>/dev/null | |
mv /tmp/googleplay/now /tmp/googleplay/after | |
curl "${URL}" -o /tmp/googleplay/now | |
len=`diff /tmp/googleplay/now /tmp/googleplay/after |wc -l` | |
if [ $len != 0 ]; then | |
echo "${URL}" > /tmp/content.txt | |
cat /tmp/googleplay/now > /tmp/che.html | |
/usr/bin/mutt -x -s "Nexus5 available on GooglePlay" -a \ | |
/tmp/che.html -- ${EMAIL} < /tmp/content.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick setup tips:
Setting up postfix to work with Google Apps - http://blog.bigdinosaur.org/postfix-gmail-and-you/
Setting up this script:
chmod +x nexus5.sh
Use the following line for crontab to run every 5 minutes:
*/5 * * * * /home/mydirectory/nexus5.sh
good guide on crontab - http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/