diff --git a/index.js b/index.js index 53e8a35462e46639f2964fb5cdc212e4af9c756e..c1b87dc4a712b83d2d2f60b50a88478268213351 100644 --- a/index.js +++ b/index.js @@ -99,16 +99,13 @@ app.post('/post', function(req, res){ forecastText = forecastData.forecast.txt_forecast; var forecastBody = "##### Forecast as of " + forecastText.date + "\n"; - forecastBody += "| Day | Forecast | High | Low |\n"; - forecastBody += "|:--------------------|:------------------------------|:----------|:----------|\n"; + forecastBody += "| Day | Forecast |\n"; + forecastBody += "|:--------------------|:------------------------------|\n"; forecastText.forecastday.forEach( function( entry, index ) { - var forecastDetails = forecastData.forecast.simpleforecast.forecastday[ index ]; - - if ( 'undefined' !== typeof forecastDetails ) { - forecastBody += ' | ' + entry.title + ' | ' + entry.fcttext + ' | ' + forecastDetails.high.fahrenheit + ' | ' + forecastDetails.low.fahrenheit + " |\n"; - } + forecastBody += ' | ' + entry.title + ' | ' + entry.fcttext + " |\n"; } ); + responseBody.attachments[1] = { "text": forecastBody }; res.send( responseBody );