Skip to content

Instantly share code, notes, and snippets.

@andreivolt
Last active January 20, 2022 20:01
Show Gist options
  • Save andreivolt/d915869aebd5b850a372e9a23c3c4477 to your computer and use it in GitHub Desktop.
Save andreivolt/d915869aebd5b850a372e9a23c3c4477 to your computer and use it in GitHub Desktop.
track shipments with Aftership
#!/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