Logo Lanfrica

ishan-marikar/dialog-data-meter

Domaine:

digital infrastructure

Type de record:

software
Créateur:
ish
Hôte:
A module to measure and monitor your Dialog 4G/LTE data usage [DEPRECATED] # dialog-data-usage made use of an API issue with Dialog Axiata's systems that have been patched long time ago and as a result, this module won't work anymore # dialog-data-usage A module to measure and monitor your Dialog 4G/LTE data usage ## Installation npm install dialog-data-usage --save ## Notes I don't know if this is legal or not (since I'm using some of their internal APIs), but I hope no harm will come out with me releasing this module. Please don't sue me Dialog (^^"). ## Usage ```js var dialog = require('dialog-data-usage').create({ connectionNumber: 114123456, type: 'LTE', // LTE, prepaid interval: 5000, // milliseconds limit: 80 // % }); dialog.getDataUsage(function(error, data){ if(error) throw error; console.log(data); }); ``` ## API ### getDataUsage(error, data) Responds with the current data usage of your connections, along with the packages. You can use pretty-bytes to convert the bytes into human-readable strings. ```js dialog.getDataUsage(function(error, data){ if(error) throw error; console.log(data); }); [ { quotaId: 'day-time-data', packageCode: 'LTE_Home', packageName: 'Any Time Data', totalQuota: 26843545600, usedQuota: 26843545600, balanceQuota: 0, expiryDate: Sun Mar 20 2016 00:00:00 GMT+0530 (IST) }, { quotaId: 'night-time-data', packageCode: 'LTE_25GB_NT', packageName: 'Night Time Data (12 midnight - 8 a.m)', totalQuota: 26843545600, usedQuota: 26843545600, balanceQuota: 0, expiryDate: Sun Mar 20 2016 00:00:00 GMT+0530 (IST) }, { quotaId: 'extension-data', packageCode: 'LTE_More3', packageName: 'Data Extension', totalQuota: 21474836480, usedQuota: 21474836480, balanceQuota: 0, expiryDate: Sun Mar 20 2016 00:00:00 GMT+0530 (IST) } ] ``` ### getDataUsageHistory(error, data) Responds with your your data sessions over a certain time period. __Note: This doesn't seem to work anymore because they've patched their API, and actually started verifying data it receives. It now needs your IMSI (globally-unique code number that identifi …

Languages