Skip to content

Instantly share code, notes, and snippets.

@poliva

poliva/nexus5.sh Secret

Created October 18, 2013 12:21
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save poliva/86a604eac604a11e37cc to your computer and use it in GitHub Desktop.
Save poliva/86a604eac604a11e37cc to your computer and use it in GitHub Desktop.
#!/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