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
var dialog = ; dialog;
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.
dialog; 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+ 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+ quotaId: 'extension-data' packageCode: 'LTE_More3' packageName: 'Data Extension' totalQuota: 21474836480 usedQuota: 21474836480 balanceQuota: 0 expiryDate: Sun Mar 20 2016 00:00:00 GMT+
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 identifies a GSM subscriber to the network).
dialog; quotaID: 'night-time-data' packageName: 'Night Time' date: Wed Mar 02 2016 00:00:00 GMT+ usedQuota: 40726691 balanceQuota: 13765370183 quotaID: 'extension-data' packageName: 'Extension' date: Thu Mar 03 2016 00:00:00 GMT+ usedQuota: 489989079 balanceQuota: 5744518758 quotaID: 'extension-data' packageName: 'Extension' date: Fri Mar 04 2016 00:00:00 GMT+ usedQuota: 74385981 balanceQuota: 5669356830 quotaID: 'night-time-data' packageName: 'Night Time' date: Fri Mar 04 2016 00:00:00 GMT+ usedQuota: 268435456 balanceQuota: 13464722472 quotaID: 'extension-data' packageName: 'Extension' date: Sat Mar 05 2016 00:00:00 GMT+ usedQuota: 3070901616 balanceQuota: 2598455214
listen() [ALPHA]
Polls the API and emits events. Currently emits 'update', 'limit', and 'finished'. Just note that this is a random feature I decided to add and is currently buggy (because there probably is a better way to do this).
dialog; var iteration = 0;dialog; listen; listen;
Tests
No tests yet.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Bugs
Plenty. If you find any, please do let me know. I also don't mind pull-requests, so if you want to contribute, please do. c:
Release History
- 0.1.0 Initial release