A JSON tale of tracking

I asked the seller of the N810’s battery to send it via Shalom, and I’d pick it up from their agency. Shalom’s service has improved a lot in these years, it’s really good. They have a website now for tracking your package.

The only downside is, when you reload the page to get an update, it asks again for the tracking code and order number. By the 10th reload (yes, I was excited) I got tired of copying and pasting.

But I’m a developer! Automation’s my game! I opened Firefox’s Dev Tools, inspected the Network requests and, yup, there’s an endpoint there that returns a JSON payload.

I tried it with curl and it answered, it doesn’t require authentication at all. I piped the output to a basic jq . for readability and then called these commands using watch, so they’ll get executed every 300 seconds (5 minutes). I moved my terminal emulator to my secondary monitor and, voilà, now I have realtime status updates!

As I did this, I was laughing maniacally like a mad scientist.

Hours later I noticed the destino («destination») key has changed and was now populated. It arrived and it’s ready for pick up! Yay!

And this is how the final payload looked like after I picked it up:

And now, time to face the moment of truth. Will the battery be fine? Will the N810 boot without issues? WILL IT WORK!?

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *