Warning:
-
chartjs-plugin-trendline.js
will break charts if there are empty values
Requirements
(most are optional as the scripts are quite simple)
If on macOS / BSD
-
coreutils
from Homebrew or similar. That's for gettinggdate
– the Unixdate
command, for not having to deal with the incompatible BSDdate
command.
Universal
- ChartJS
- chartjs-plugin-trendline.js
jq
bc
sqlite3
curl
- Healthchecks.io instance (optional)
uglify-js
scp
Setup
Warning! Please make sure you have all the requirements from above!
- clone or download this repository
cp .env.sample .env
- edit and doublecheck the
.env
file 3.1 if you have changed the range of months, head to the according file in./src/
and adjust the charts, this is not automated yet, sorry! - prepare your database, which acts as a cache for already known months:
populate=true bash donate-insights.sh
- if everything seems fine, remove the
populate=true
variable so the script actually generates your stuff - even if there was an uglify or scp error, you can now test the output using the
test.html
file. - prepare your website (see below)
- add your cron, for example:
0 8-20/2 * * * /bin/bash /path/to/donate-insights/donate-insights.sh
Prepare your website
Review the test.html
file and use it as a cheatsheet in order to display the generated contents on your own website.
Troubleshooting
The script tries to be silent by default. If you need more information on whats happening, append or configure the debug=true
variable.