Every day at a set time, retrieve bandwidth usage and statistics from your ISP.
Currently only works with Teksavvy, though can be modified for different API structures.
Instructions for use:
- Clone the repo to your local environment
- In teksavvy_cron.py, replace "API_KEY" with your generated API key from TekSavvy
- In teksavvy_cron.py, replace "email@gmail.com" and "pass" with your email and password. I created a seperate deamon email account so as not to potentially comprimise my own account. Replace the TO field with your personal email that you would like to receive the information on.
- (Optional) Customize the message and usage statistics to be displayed in the TEXT and SUBJECT fields.
- Test by navigating to the directory and invoking "python teksavvy_cron.py"
- If everything is working, you should recieve an email that looks quite close to the following:
- Add the file to your crontab by invoking "crontab -e" in a fresh terminal window. This will default to your default text editor, which for me is vi.
- Add the following line to your crontab, replacing values as desired: 0 9 * * * /path/to/python /path/to/teksavvy_cron.py
- Ta-da! Hopefully it works. If not, raise an issue on this repo and we'll try to sort it out.
Note that the computer has to be on to run the program. I have mine running every morning at 9 am on a headless raspberry pi connected to the internet. This tiny script will not interfere with whatever else you're using an rpi for, so I would highly recommend doing it this way.
#import time. :D