I wrote a simple script in Python for a BTC mining pool I use. The script checks my “earnings” by sending a query with my API token and receives a JSON data about my miners and user’s profile. Data about my earnings is stored in a SQLite3 database and then the script generates charts out of it. To generate the charts I used PyGal framework – it makes SVG files which I find really great (and I like SVG).
The script was copied to my /var/www/miner directory (set this up in the PyMinerStats.py file!), setup in /etc/crontab to run 3 times a day:
0 0,8,16 * * * root python /var/www/miner/PyMinerStats.py
The script runs on my Raspberry Pi, so it’s nearly never off, but if you turn your computer off, please set-up cron as you want.
After few days, you will have five nice looking charts: