Simple Node script to open your weekly supply drop, so you don't have to!
Sends a push notification (optional) when a supply drop is opened or an error occurs. You could have this run every week on a Raspberry Pi with a CRON job.
cp .env.template .env
- Edit
.env
and set all vars accordingly yarn install
- For Node v13+ run
npm start
or if you run Node v12 or lowernpm run node11
To setup Push notifications you need to setup an account with Pushover. You can try it out for free for 7 days and after that choose to unlock forever for 5$ per device platform (e.g. unlock it for all Apple devices).
- Create your account
- Download the Pushover app on your phone and login
- Create a new Pushover app and call it something like "Supply Drop". You'll get a code, this is the
PUSHOVER_TOKEN
you should add in your.env
file. - Find your "User Key" on the Pushover dashboard and set this to
PUSHOVER_USER
- Done!
All logs are written to logs/app.log
Supply drops are replenished every Monday-night. The below CRON entry will run this script every Tuesday morning at 8am:
0 8 * * TUE (cd ~/scripts-bin/supply-drop && /usr/local/bin/node --experimental-modules -r dotenv/config index.mjs) > /var/log/webhallen-supplydrop.log
You should change the paths to where you've cloned this repo.
Note that I'm running this on an old Raspberry Pi (arm6), meaning that the latest support version of Node is v11. If you're running Node v13+ you can change npm run node11
with npm start
.
crontab -e
- Add the above snippet to the end of the file
ctrl + o
to savectrl + x
to quit