Last Updated: February 25, 2016
·
1.294K
· nosuid

Check when Nexus 4 has stock again

If you want to get a Nexus 4 and you are waiting for the Play Store to get new stock, you can automatically check by using this bash script:

#!/bin/bash

while true
do
  if [ `curl "https://play.google.com/store/devices/details?id=nexus_4_16gb" | grep -io "Sold out" | wc -l` -lt 1 ]
then
  echo "In stock"
  # You can send yourself an email here
  exit 1
fi
echo "Not in stock :("
sleep 900
done

1 Response
Add your response

Gorgeous!! Here Spanish version that send push using PushOver

#!/bin/bash
while true
do
    if [ `curl "https://play.google.com/store/devices/details?id=nexus_4_16gb&hl=es" | grep -io "AGOTADO" | wc -l` -lt 1 ]
then
    echo "In stock"
    curl -s -F "token=TOKEN_APP" -F "user=USER_KEY" -F "message=Corre por el Nexus 4" https://api.pushover.net/1/messages.json
    exit 1
fi
echo "Not in stock :("
sleep 120
done
over 1 year ago ·