Minds your USMobile pool so you don't have to
WARNING!!! Use at your own risk!!!
This script is new, uses undocumented APIs, and makes purchases for you.
It can potentially run amok and purchase many gigabytes of data. I built in a few safeguards but I make no promises.
WARNING!!! Use at your own risk!!!
Still reading?
You've been warned.
Well ok then. Go ahead and clone this repo or just copy the config.yaml-template file and docker-compose.yaml file to a local directory.
- Rename the config file to config.yaml.
2. You can also configure any setting via an environment variable upper-cased & prefaced with
LIFEGUARD_. - You need to get the app an authentication token and a pool id. To accomplish this:
- Log into your USMobile account in a private window.
- Navigate to the pool detail page for the pool you want it to watch. It'll have a URL that looks something like https://app.usmobile.com/dashboard/app/pools/ffffffff.
- That string of hex characters (the
ffffffffin my exmple) is your pool id. Put it in the yaml file inside the quotes next topool_id. - Go into web developer tools in the browser and look at the network tab. You'll probably have to refresh the page to get it to show you anything interesting.
- Look for a request to
api.usmobile.com. Select it. - Scroll down to the request headers and look for the
USMAuthorizationheader. - The value for that header should start with
Bearer ey. Grab the whole long string starting witheyand copy it into thetokenfield.
- Edit the rest of the values in the file to suit your preferences. There are comments in there that should be self-explanatory.
- To run the app, use the command:
docker compose up --build. - Keep an eye on the output. If it does anything unexpected kill it and check your configuration.
- It will give you a 10 second warning before performing a top up. That gives you a chance to kill it if you're watching.
- The config file can be changed while the application is running. The changes take affect on the next cycle - no need to restart.