Daily Position Cron

As you probably know from my blog, I have a number of Arduino’s around the house for monitoring household and weather metrics and I’m always looking for ways to add more devices and data sets.

My dad happened to find a map one summer on to view live lightning strikes and we decided to sign up for a lightning detector in December 2015 (I think!).  When you register you use your email address and can see where you are in the list of people who want a device by going back to and filling in your email + the other boxes.

After one year on the waiting list, our position in the queue had moved a bit, but it became tedious checking the list once a week, so I wrote a script that I’ve now made generic enough for anyone.  Simply add it to crontab and take the pain out of checking every week 🙂

GitHub gist:



epc=$(date +%s)
echo $epc

# Country does not seem to be important
res=$(curl --data "info_time=$epc&info_email=$email&info_country=United+Kingdom&info_text=TSqrb"
#echo "-----------------------------"
#echo "HTML Response"
#echo $res
#echo "-----------------------------"

html=$(echo "$res" | grep $email)
#echo "-----------------------------"
#echo "Position Text"
#echo $html
#echo "-----------------------------"

echo "textpositionstart: $textpositionstart"

position=$(echo $position | sed 's@^[^0-9]*\([0-9]\+\).*@\1@')
echo "position: $position"

lastposition=$(cat $lastpositionfilename)
echo "catresult $catresult"
if [ "$catresult" -eq "1" ]; then
    echo "didn't find last position file"
    echo "found last position file"
echo "lastposition: $lastposition"

if [ "$position" -lt "$lastposition" ]; then
    echo $position | mail -s " position" $email
    echo $position > $lastpositionfilename
    echo "position not less than $lastposition: $position"


The only input to the script is the email address you’ve used on the waiting list (assuming you haven’t hardcoded it in the script like I have).  You don’t need country as that doesn’t appear to be used by the site to verify the email address.