kluzny / parcurls
A simple utility class to resolve parcel tracking urls
1.0.1
2019-12-31 02:20 UTC
Requires
- php: ^7.0
This package is not auto-updated.
Last update: 2024-05-01 22:26:20 UTC
README
ParcUrls ( read as "parcels", so clever ) is a small utility class to help resolve tracking numbers into tracking urls from several of the larger parcel services. This is a direct fork of darkain/php-tracking-urls with the goals of:
- Autoloading
- Namespacing
- Classes, because classes
- Preference of spaces vs tabs
- Access to metadata like carrier
Supported shippers:
- United States Postal Service (USPS)
- United Parcel Service (UPS)
- Federal Express (FedEx)
- OnTrac
- DHL
Install
Note that the package names are lowercase
composer require kluzny/parcurls
Example
Usage:
use kluzny\ParcUrls\Parser; $parser = new Parser("92748963438592543475924253"); echo $parser->url; # https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=92748963438592543475924253 echo $parser->tracker['carrier']; # USPS echo $parser->tracker['description']; # United States Postal Service
Bugs
Feel free to create pull requests, but they must include passing test cases. I'm not particularly interested in maintaining this or any other PHP code.