Send love messages to your dearly beloved via your favorite HTTP action.
This app retrieves the message of the day from a Google Spreadsheet and sends it via 46elks' messaging API to a specified number. The app is tailored for running on a free Heroku dyno and to be called daily via a free cron service (e g Crondash).
Call the /message endpoint with POST, the query var key set to the API_KEY defined in the env vars and the receiver_number body var set to the international format of the receiving number.
$ curl -X POST http://localhost:8080/message?key=abc123 -d "receiver_number=+46701231231"
- Set the env vars in the Heroku app panel
$ npm install$ heroku local
The following env vars are required
API_KEY: The API key for the applicationELKS_API_PASSWORD: Your 46elks passwordELKS_API_USERNAME: Your 46elks usernameGOOGLE_SPREADSHEET_ID: The ID of the message spreadsheetMESSAGE_SENDER_NAME: Name of the sender
It's possible to log everything at a certain log level to Slack. In order to achieve that, set the following env vars:
SLACK_API_TOKEN: API tokenSLACK_CHANNEL: Name of channel to post toSLACK_DOMAIN: Sub domain for the slack organizationSLACK_LOG_LEVEL: Log level, default is infoSLACK_USERNAME: Username of integration
- Define the env vars for production in .env
$ npm install$ heroku local
Run tests with $ npm run test
Watch tests with $ npm run test:watch
Run test coverage report with $ npm run test:coverage
The messages to be sent are retrieved from a Google Spreadsheet. This sample sheet has ID 1WQNN7rUDkpccCtDu6QDQUu2z1wE8msOZS8QWcFw5kvQ, which is what is supposed to be the value of the env var GOOGLE_SPREADSHEET_ID.