https://github.com/simov/slack-command-weather
Weather Forecast /slash Command for Slack
https://github.com/simov/slack-command-weather
Last synced: about 1 year ago
JSON representation
Weather Forecast /slash Command for Slack
- Host: GitHub
- URL: https://github.com/simov/slack-command-weather
- Owner: simov
- License: apache-2.0
- Created: 2018-11-15T13:12:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-22T12:49:54.000Z (over 7 years ago)
- Last Synced: 2025-06-30T02:06:01.875Z (about 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-command-weather
> Weather Forecast /slash Command for Slack
## middleware
```js
var express = require('express')
var weather = require('slack-command-weather')
var auth = {google: 'API key', darksky: 'API key', slack: 'hook token'}
express()
.use(weather(auth))
.listen(3000)
```
## api
```js
var express = require('express')
var parser = require('body-parser')
var weather = require('slack-command-weather')
var auth = {google: 'API key', darksky: 'API key', slack: 'hook token'}
express()
.use(parser.urlencoded({extended: true}))
.use((req, res) => {
var input = req.body
res.json(weather.respond({auth, input}))
weather.query({auth, input}).catch(console.error)
})
.listen(3000)
```
## command
Option | Value
:-- | :--
Command | `/weather`
Request URL | `https://website.com/weather`
Short Description | `Weather Forecast`
Usage Hint | `[location]`
## example
Command | Description
:-- | :--
`/weather tokyo` | current weather in Tokyo
`/weather help` | help message
[geoip]: https://developers.google.com/maps/documentation/geocoding/start
[darksky]: https://darksky.net/dev/