View Single Post
Posts: 53 | Thanked: 104 times | Joined on Jan 2011 @ Veska, Czech Rep.
#481
Originally Posted by ste-phan View Post
Is there an Android app yet that alerts whenever my Jolla order changes from "paid" to "picking" to...?
Don't know about Android app, but I've made a quick & dirty bash script for automatic checking of my order status, if anyone interested:

Code:
# cat check_order_status.sh
Code:
#!/bin/bash

email="your@email.org"
username="your.login@email.net"
password="_secret-pass_"

echo "Getting login page..."
curl -s -c cookie.txt https://shop.jolla.com/customer/account/login/ > /dev/null
echo "Sending POST data..."
curl -s -b cookie.txt -c cookie.txt -d "login[username]=$username" -d "login[password]=$password" -d "send=" https://shop.jolla.com/customer/account/loginPost/ > /dev/null
echo "Getting orders list..."
orders=`curl -s -b cookie.txt https://shop.jolla.com/sales/order/history/`
echo "Filtering status..."
order_status=`echo $orders | sed -e 's/.*<td><em>//g' -e 's/<\/em>.*$//g'`

if [ ! -f status.txt ]; then
        echo "unknown" > status.txt
fi

if [ "`cat status.txt`" == "$order_status" ]; then
        echo "Status of your order is still $order_status, nothing to do but wait."
else
        echo "Wohoo, your order status has just changed do $order_status, sending e-mail notification!"
        echo "Time to celebrate, after endless waiting your Jolla order status just changed to $order_status!" | mail -s "Your Jolla order status changed to $order_status" $email
        echo $order_status > status.txt
fi
echo "Done."
Just added it to crontab and now I can do more useful things than checking Jolla's store page

I'm not a bash expert, so it surely could be done better. For the mail commad to work, you need to have set up local MTA. Also, if you're going to use this in any way, please don't hammer Jolla's server and set the check interval to maybe 30 minutes or so...

Edit: Added quotes to condition parameters, so it correctly handles the two words in "In picking" status.

Last edited by jamar; 2013-12-13 at 17:10.
 

The Following 18 Users Say Thank You to jamar For This Useful Post: