Created
December 19, 2017 16:39
-
-
Save jrasanen/0c6a053fb927aea68e2dcb1e4c379daa to your computer and use it in GitHub Desktop.
poll for postipaketti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! [ -x "$(command -v jj)" ]; then | |
brew tap tidwall/jj | |
brew install jj | |
fi | |
while true; do | |
echo -n "`date` " && \ | |
curl -s 'https://www.posti.fi/henkiloasiakkaat/seuranta/api/shipments' \ | |
--data '{"trackingCodes":["JJFI..."]}' \ | |
-H 'Content-Type: application/json;charset=utf-8' \ | |
| jj shipments.0.events.0.description.fi \ | |
| xargs | |
sleep 1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment