From cac638f1e39f1ad0abf291778614be08a55fc437 Mon Sep 17 00:00:00 2001 From: Erick Hitter <services@ethitter.com> Date: Fri, 13 Jan 2017 22:53:28 -0800 Subject: [PATCH] Basic forecast layout --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 0816eec..ad1b47f 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 ); }); -- GitLab