- Create HTTP server that listens on port
4000
- Use
/yourname [location]
Slack command to send a string to your server - Pipe the received string location to the Google's Geocoding API
- Pipe the returned
lat,lng
coordinates to the DarkSky's Weather API - Map the weather forecast data to Slack Attachment JSON object
- Send it back to Slack
- Use the Google Cloud Platform to create API key for the Geocoding API
- The request URL for the Geocoding API is:
https://maps.googleapis.com/maps/api/geocode/json
- Go to DarkSky to create API key for the Weather Forecast API
- The request URL for the Weather Forecast API is:
https://api.darksky.net/forecast/[api_key]/[lat,lng]
- Example Slack Attachment:
- Send feedback back to your users immediately (the grey line above), send the attachment to the
response_url
of the request body when ready