diff --git a/index.js b/index.js index 0816eecf56324db9987ac3a7beb157f1243583e4..ad1b47f5c685b7949978e3fdc24dba2b91a72f04 100644 --- a/index.js +++ b/index.js @@ -95,7 +95,15 @@ app.post('/post', function(req, res){ } // Build forecast into a table + var forecastData = JSON.parse( body ); + var forecastBody = "---\n#### **Forecast as of " + forecastData.forecast.txt_forecast.date + '**'; + forecastBody += "| Day | Description | High | Low |"; + forecastBody += "|:--------------------|:---------------------------------|:-------|:-------|"; + forecastBody += "| Monday, Feb. 15 | Cloudy with a chance of flurries | 3 °C | -12 °C |"; + forecastBody += '---'; + + responseBody.attachments[1] = { "text": forecastBody }; res.send( responseBody ); });