Get notified when a famous person dies. https://fwdekker.com/tools/death-notifier/
Go to file
Florine W. Dekker 8655e8933c
Graduate Death Notifier to 1.0.0 :D
2022-12-18 23:28:19 +01:00
src Graduate Death Notifier to 1.0.0 :D 2022-12-18 23:28:19 +01:00
.editorconfig Add Composer and npm to project 2022-08-09 19:20:02 +02:00
.gitattributes Add Composer and npm to project 2022-08-09 19:20:02 +02:00
.gitignore Clean up server-side by, like, a lot 2022-08-29 01:09:33 +02:00
Gruntfile.js Add tests for EmailQueue 2022-12-17 18:05:43 +01:00
LICENSE Add Composer and npm to project 2022-08-09 19:20:02 +02:00
README.md Add tests for EmailQueue 2022-12-17 18:05:43 +01:00
composer.json Graduate Death Notifier to 1.0.0 :D 2022-12-18 23:28:19 +01:00
composer.lock Graduate Death Notifier to 1.0.0 :D 2022-12-18 23:28:19 +01:00
package-lock.json Graduate Death Notifier to 1.0.0 :D 2022-12-18 23:28:19 +01:00
package.json Graduate Death Notifier to 1.0.0 :D 2022-12-18 23:28:19 +01:00
phpstan.neon Add phpstan and resolve almost all issues 2022-08-14 17:47:18 +02:00
tsconfig.json Improve CSRF handling and session management 2022-08-12 17:06:21 +02:00

README.md

Death Notifier

Get notified when a famous person dies.

Wikipedia's editors are known for updating pages as soon as someone has died. Why not turn that into a service? This tool regularly checks if people are still alive according to Wikipedia, and emails you as soon as that changes.

Development

Requirements

  • PHP 8.1+ (i.e. apt install php php-cgi)
  • composer (make sure composer.phar is on your path)
  • npm

Setting up

# Install dependencies (only needed once)
$> composer.phar install
$> npm ci

Building

# Build the tool in `dist/` for development
$> npm run dev
# Same as above, but automatically rerun it whenever files are changed
$> npm run dev:server
# Build the tool in `dist/` for deployment
$> npm run deploy

Pre-commit

# Update lock files
$> composer.phar update
$> npm install

Static analysis

# Run static analysis
$> npm run analyze
# Run all tests
$> npm run test
# Run all tests in package
$> npm run test -- --test-target=com/fwdekker/deathnotifier/wikipedia/
# Run static analysis and tests
$> npm run check

Deployment

Build the software and move it to the right directory.

$> npm run deploy  # Build
$> mv dist/ /var/www/death-notifier/  # Move to public directory

Then, add the following lines to your crontab using sudo -u www crontab -e:

* * * * * cd /var/www/death-notifier && php /var/www/death-notifier/api.php action=process-email-queue password=secret_password
*/5 * * * * cd /var/www/death-notifier && php /var/www/death-notifier/api.php action=update-all-trackings password=secret_password

It is recommended to also use a tool such as newsyslog to manage log rotation.