Giter Club home page Giter Club logo

webhallen-supply-drop's Introduction

Webhallen Supply Drop opener

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.

Notification on Phone

Quick start

  1. cp .env.template .env
  2. Edit .env and set all vars accordingly
  3. yarn install
  4. For Node v13+ run npm start or if you run Node v12 or lower npm run node11

Push notifications (optional)

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).

  1. Create your account
  2. Download the Pushover app on your phone and login
  3. 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.
  4. Find your "User Key" on the Pushover dashboard and set this to PUSHOVER_USER
  5. Done!

Logs

All logs are written to logs/app.log

Scheduled run with CRON

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.

Setup CRON on Linux/macOS

  1. crontab -e
  2. Add the above snippet to the end of the file
  3. ctrl + o to save
  4. ctrl + x to quit

webhallen-supply-drop's People

Contributors

mirague avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.