Last active
January 20, 2022 20:01
-
-
Save andreivolt/d915869aebd5b850a372e9a23c3c4477 to your computer and use it in GitHub Desktop.
track shipments with Aftership
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
#!/usr/bin/env bash | |
jo direct_trackings=$(jo -a $(jo tracking_number=$1)) \ | |
| http https://track.aftership.com/api/v2/direct-trackings/batch \ | |
| jq -r ' | |
.data.direct_trackings | |
| first | |
| .tracking.checkpoints[] | |
| [ | |
( | |
.date_time | |
| strptime("%Y-%m-%dT%H:%M:%S+%Z") | |
| strftime("%d-%m %H:%M") | |
), | |
.slug, | |
.message | |
] | |
| @tsv' \ | |
| column -t -s$'\t' \ | |
| cut -c -$COLUMNS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment