Never go over your minutes again
The Virgin Mobile Minute Texter is a simple Python script that scrapes your data from Virgin Mobile's website and sends you a text with your remaining minutes. Currently only works on the Virgin Mobile USA site.
First, make sure you have Python 3 installed by typing which python3
in a terminal. If you see something like /usr/local/bin/python3
, you're good to go. If you see an error, install Python 3.
Go to https://sendhub.com and register for a free account. You'll use this service to send text messages to your phone. The free plan lets you send up to 1000 messages and 500 API requests a month. Copy your API Key from the Settings page.
Now download the script and modify your details:
VIRGINMOBILEACCOUNT = {'min':1235551234, 'vkey':0000}
Replace with your Virgin Mobile account phone number and PIN.
MESSAGETO = 13015551234
The number (with country code) that will receive the text message.
SENDHUBNUMBER = 7035551234
The phone number you used to sign up on SendHub. This is NOT the number that SendHub gave you.
SENDHUBAPIKEY = "apikeygoeshere"
Paste in the API Key here.
Now that everything is configured, run the script manually by typing:
python3 VM.py run
This will run the check and send a text message regardless of how many minutes are remaining. (Leave out the run
for it to only send a text if you're low on minutes or if it's Sunday.)
You should see output like this:
Logging in to Virgin Mobile.
Request finished.
You have 230 minutes remaining and 21 daysLeft on your plan.
...
Both requests to Virgin Mobile and SendHub use HTTPS, so they should be secure. At the moment, I have not programmed a way to obfuscate the sensitive Virgin Mobile account information at the beginning of the script. This will be my goal in coming revisions.
Now that it works, you can set it up on a server (or just your local machine) to check periodically for low minutes. One way to do this could be using cron, by adding something like this to your crontab file:
0 8,20 * * * python3 VM.py
This will trigger the script every day at 8AM and 8PM.
If something doesn't work right, please contact me.