Skip to content

Instantly share code, notes, and snippets.

@shammellee
Created August 23, 2019 22:32
Show Gist options
  • Save shammellee/afe973affa811bedcedda651be949a52 to your computer and use it in GitHub Desktop.
Save shammellee/afe973affa811bedcedda651be949a52 to your computer and use it in GitHub Desktop.
Track USPS packages
function usps_track()
{
local _USER_AGENT_CHROME_76='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'
local _URL="https://tools.usps.com/go/TrackConfirmAction?tLabels=${1}"
local _HEADER_USER_AGENT="User-Agent: ${_USER_AGENT_CHROME_76}"
curl --silent --location --header "$_HEADER_USER_AGENT" "$_URL" | pup 'h2 > strong text{}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment