Skip to content

afiqiqmal/parcel-track

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parcel Tracker

Build Status Coverage

Simple Parcel Tracker Packagist for Local Parcel Courier. Basically it just crawl the courier website. Need time to time monitor changes before failure happend.

Pftt.. I just dont know why, the Travis CI is failed. It because of gnutls_handshake() failed. In my local env, all test passed =)

  • Currently just only POSTLAJU, GDEX, ABXExpress

Tested in PHP 7.1

Installation

Step 1: Install from composer

composer require afiqiqmal/parcel-track

Alternatively, you can specify as a dependency in your project's existing composer.json file

{
   "require": {
      "afiqiqmal/parcel-tracker": "^1.0"
   }
}

Usage

After installing, you need to require Composer's autoloader and add your code.

require_once __DIR__ .'/../vendor/autoload.php';

Sample for Post Laju

$data = parcel_track()
	->postLaju()
	->setTrackingNumber("ER157080065MY")
	->fetch();

Sample for GDex

$data = parcel_track()
	->gdex()
	->setTrackingNumber("4941410530")
	->fetch();

Sample for Abx Express

$data = parcel_track()
	->abxExpress()
	->setTrackingNumber("EZP843055940197")
	->fetch();

Method

Method Param Description
postLaju() Post Laju Courier
abxExpress() Post Laju Courier
gdex() GD Express Courier
setTrackingNumber($refNumber) String Enter the tracking number

Result

You should getting data similarly like below:

{
    "code": 200,
    "error": false,
    "tracker": [
        {
            "date": "2018-02-05 16:24:20",
            "timestamp": 1517847860,
            "process": "Item posted over the counter",
            "type": "item_received",
            "event": "Pos Laju Temerloh"
        },
        {
            "date": "2018-02-05 22:01:57",
            "timestamp": 1517868117,
            "process": "Item dispatched out",
            "type": "dispatch",
            "event": "Pos Laju Temerloh"
        },
        {
            "date": "2018-02-06 03:44:45",
            "timestamp": 1517888685,
            "process": "Consignment dispatch out from Transit Office",
            "type": "dispatch",
            "event": "Pos Laju Transit Office"
        },
        {
            "date": "2018-02-07 12:20:25",
            "timestamp": 1518006025,
            "process": "Arrive at delivery facility at",
            "type": "arrived_facility",
            "event": "Pos Laju Keningau"
        },
        {
            "date": "2018-02-08 07:44:49",
            "timestamp": 1518075889,
            "process": "Arrive at delivery facility at",
            "type": "arrived_facility",
            "event": "Pos Laju Keningau"
        },
        {
            "date": "2018-02-08 07:51:36",
            "timestamp": 1518076296,
            "process": "Item out for delivery",
            "type": "out_for_delivery",
            "event": "Pos Laju Keningau"
        },
        {
            "date": "2018-02-08 14:01:24",
            "timestamp": 1518098484,
            "process": "Item delivered to HASMIN",
            "type": "delivered",
            "event": "Pos Laju Keningau"
        }
    ],
    "footer": {
        "source": "Post Laju",
        "developer": {
            "name": "Hafiq",
            "homepage": "https:\/\/github.com\/afiqiqmal"
        }
    }
}

Todo

  • Struggling for other Parcel Data

License

Licensed under the MIT license