A slack weather bot that reports the weather of a city of choice using the OpenWeatherMap API.
This bot is hosted on Heroku, which may take a while for the response ⌛ . Instructions for running this bot locally could be found below.
-
If bot is active, type in the bot followed by the city name: @Weather Bot (CITY-NAME)
example: @Weather Bot San Francisco
-
The bot will report with the appropriate message.
- Clone this repository.
- Create your own openweatherAPI_Key by creating a free account at openweatherma.
- Create your Slack API Key.
- Add in your new keys to your
.bash_profilein your terminal.export SLACK_TOKEN='xoxb************'; export OpenWeather_API_Key='644***********'; - Install dependencies:
npm install - Start running bot:
npm start - Type in @Weather Bot (CITY-NAME) into a Slack channel with the city of choice.
- @Weather Bot covers basic weather report to the user
- High and Low temperature of the day and description of the weather
- Bot looks for key words in description of weather, such as
cloudy, to determine emojis and messages to send back to user- Can be improved by making messages more descriptive after more familiarity/research of weather conditions (ex. humidity, pressure, wind, etc) at different places.
- Deployed using Heroku
- Initially, I tried out Dialogflow to check out if natural language could be used to train the bot. This process covered more than what the basic weather bot intended.
- Configuration of secret tokens was something that needed to be thought out more.
- Can look for ways to improve so users wouldn't have to create new tokens
- Useful link from Heroku
- Storing API keys
This project is licensed under the MIT License.
- Build a Slackbot: Useful youtube video to help get me started
- Learn How to Build Slack Bot Node.js: Blog with more details using node.js
- Deploying Slack Bots to Heroku
- Resolving crashes
- How to build a SlackBot
