Slack bot for weather
Slack bot to get weather details.
Prerequisites
Checkout code:
git checkout https://github.com/jainishshah17/slack-weather-bot.git
Install Npm dependencies:
cd slack-weather-bot/
npm install
Create Slack App
Signing Secret
and store it in .env file.OAuth Access Token
and store it in .env file.Start Weather app server
npm start
Install and run Ngrok
npm install -g ngrok
ngrok http 3000
## You will see output like following
ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Session Expires 7 hours, 59 minutes
Version 2.3.35
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://c1219f73.ngrok.io -> http://localhost:3000
Forwarding https://c1219f73.ngrok.io -> http://localhost:3000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
Create Slash Command in Weather Slack App we created
Go to Features -> Slash Commands -> Click on Create New Command
Provide following details for new slash command:
Command: /weather
Request URL: https://c1219f73.ngrok.io/
(Note:Use your ngrok generated HTTPS URL)
Short Description: Get current weather information by City or ZipCode
Usage Hint: San Jose
Go to slack and type /weather San Jose
or /weather 95112
to see the magic: