src/pitneybowesTracker.js
function obtainInfo(id, action, cb) {
    request.get({
        url: action,
        timeout: 20000,
        strictSSL: false
    }, function (error, response, body) {
        if (error || response.statusCode != 200) {
            cb(utils.errorDown())
            return
        }

        // Not found
        if (body.indexOf('errorMessage') != -1) {
            cb(utils.errorNoData())
            return
        }

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

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

        // Not found
        if (body.indexOf('errorMessage') != -1) {
            cb(utils.errorNoData())
            return
        }

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

        if(entity != null) cb(null, entity)
    })
}
function obtainInfo ( id , action , cb ) { request . get ( { url : action , timeout : 20000 , strictSSL : false } , function ( error , response , body ) { if ( error || response . statusCode != 200 ) { cb ( utils . errorDown ( ) ) return } // Not found if ( body . indexOf ( 'errorMessage' ) != - 1 ) { cb ( utils . errorNoData ( ) ) return } let entity = null try { entity = createParcelTrackerEntity ( body ) } catch ( error ) { return cb ( utils . errorParser ( id , error . message ) ) } if ( entity != null ) cb ( null , entity ) } ) }
Get info from parcel tracker request

@param action
@param id
@param cb
Get info from parcel tracker request