Created
August 23, 2019 22:32
-
-
Save shammellee/afe973affa811bedcedda651be949a52 to your computer and use it in GitHub Desktop.
Track USPS packages
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
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