Based on: https://gathering.tweakers.net/forum/view_message/69930184
It runs every 5 mins (can be set with ENV variable UPDATE_INTERVAL
), and requests new bundle when MB's is less than 2000.
Firstly a login token is retrieved via the "regular" log in URL, from which a Bearer token is retrieved.
With the Bearer token the regular API is used to request: current bundles, how much is left on these bundles and then (when needed) a new bundle is requested.
Every request is retried at least 10 times when a request fails.
PM2 is used so it should restart if it crashes.
There are 3 main ways to use this software in production:
- running the Node.js locally
- running it as a Docker container
- running it as a Docker container via docker-compose
To run this script, an authorization token is needed. Obtain the token using the Odido Authenticator tool: Odido Authenticator latest Release
git clone https://github.com/lodu/TMobile-NL-Unlimited-Bundle-Automated
yarn
ornpm install
- create a file called
.env
in root folder with contents:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL=5
yarn build
ornpm run build
yarn start-daemon
ornpm run start-daemon
- Done
- create a file called
.env
:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL=5
docker pull ghcr.io/lodu/tmobile-nl-unlimited-bundle-automated:main
docker run --env-file .env ghcr.io/lodu/tmobile-nl-unlimited-bundle-automated:main
- create a file called
.env
:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL=5
- copy
docker-compose.yaml
to a localdocker-compose.yaml
file docker-compose up -d
-
git clone
the repo (duhh) -
Create
.env
file in root directory:AUTHORIZATIONTOKEN=xxxxxxxxxx MSISDN=+3161234567890 UPDATE_INTERVAL=5
-
Install packages:
yarn
ornpm install
-
Run in development for filewatcher
yarn dev
ornpm run dev
-
Do ya thing.
PR's/MR's are welcomed if you have any additions and or points of improvement
Please feel free to open an issue, I'm glad to help. However do not use it as a tech support please...