src/malaysiaPosTracker.js
function obtainInfo(action, id, cb) {
    request.post({
        url: action,
        form: {
            trackingNo03: id
        },
        timeout: 20000
    }, function (error, response, body) {
        if (error || response.statusCode != 200) {
            cb(utils.errorDown())
            return
        }

        // Not found
        if (body.indexOf('Please insert the correct Tracking Number.') != -1) {
            cb(utils.errorNoData())
            return
        }

        let entity = null
        try {
            entity = createMalaysiaPosEntity(body)
        } catch (error) {
            return cb(utils.errorParser(id, error.message))
        }

        cb(null, entity)
    })
}
function obtainInfo(action, id, cb) {
    request.post({
        url: action,
        form: {
            trackingNo03: id
        },
        timeout: 20000
    }, function (error, response, body) {
        if (error || response.statusCode != 200) {
            cb(utils.errorDown())
            return
        }

        // Not found
        if (body.indexOf('Please insert the correct Tracking Number.') != -1) {
            cb(utils.errorNoData())
            return
        }

        let entity = null
        try {
            entity = createMalaysiaPosEntity(body)
        } catch (error) {
            return cb(utils.errorParser(id, error.message))
        }

        cb(null, entity)
    })
}
function obtainInfo ( action , id , cb ) { request . post ( { url : action , form : { trackingNo03 : id } , timeout : 20000 } , function ( error , response , body ) { if ( error || response . statusCode != 200 ) { cb ( utils . errorDown ( ) ) return } // Not found if ( body . indexOf ( 'Please insert the correct Tracking Number.' ) != - 1 ) { cb ( utils . errorNoData ( ) ) return } let entity = null try { entity = createMalaysiaPosEntity ( body ) } catch ( error ) { return cb ( utils . errorParser ( id , error . message ) ) } cb ( null , entity ) } ) }
Get info from malaysiaPos page

@param action
@param id
@param postalcode
@param cb
Get info from malaysiaPos page