Skip to content
Snippets Groups Projects

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 getting gdate – the Unix date command, for not having to deal with the incompatible BSD date command.

Universal

Setup

Warning! Please make sure you have all the requirements from above!

  1. clone or download this repository
  2. cp .env.sample .env
  3. 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!
  4. prepare your database, which acts as a cache for already known months: populate=true bash donate-insights.sh
  5. if everything seems fine, remove the populate=true variable so the script actually generates your stuff
  6. even if there was an uglify or scp error, you can now test the output using the test.html file.
  7. prepare your website (see below)
  8. 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.