Auto Pilot retrieves the earthquakes from Kandilli's official website and sends notifications via Slack application.
A step by step series of examples that tell you how to get a development env running
First of all, install the package using:
npm install kandilli
or
yarn add kandilli
Before running the application, you need to set the SLACK_TOKEN by creating a file called nodemon.json
touch nodemon.json
Then, copy the content into this file
{
"env": {
"SLACK_TOKEN": "xoxp-xxxx-xxxx-xxxx"
}
}
After importing the package with
const kandilli = require('kandilli')
you can simply run the function for each X minutes using setInterval function.
const SECOND = 1000
const MINUTE = SECOND * 60
let earthQuakes = []
earthQuakes = kandilli(earthQuakes)
setInterval(function () {
earthQuakes = kandilli(earthQuakes)
}, MINUTE * 5)
If function detects any newly occurred earthquakes, it will send a slack notification to given SLACK_TOKEN's channel.
- Yavuz koca - Junior Software Developer - NOD
See also the list of contributors who participated in this project.