           handleWeather(json, callback)
 
   fetchForecast = (callback) ->
-    forecastKey = process.env.HUBOT_FORECAST_KEY
-    unitType = process.env.HUBOT_FORECAST_UNITS || 'si'
-    exclude = 'flags'
-
-    base_url = "https://api.forecast.io/forecast/#{forecastKey}/#{LOCATION}"
-    url = "#{base_url}?units=#{unitType}&exclude=#{exclude}"
+    base_url = "https://api.forecast.io/forecast/#{FORECASTKEY}/#{LOCATION}"
+    url = "#{base_url}?units=#{UNITTYPE}&exclude=#{EXCLUDE}"
 
     console.log "[Forecast] Requesting forecast data: #{url}"
 

last_json = {}

module.exports = (robot) ->
  postWeatherAlert = (json, callback) ->
    postMessage = callback
    now = new Date()

KV_KEY = 'forecast-alert-datapoint'
LOCATION = process.env.HUBOT_LATITUDE + ',' + process.env.HUBOT_LONGITUDE
PROBABILITY_THRESHOLD = process.env.HUBOT_FORECAST_PROBABILITY_THRESHOLD || 0.75
FORECASTKEY = process.env.HUBOT_FORECAST_KEY
UNITTYPE = process.env.HUBOT_FORECAST_UNITS || 'si'
EXCLUDE = 'flags'

activeDays = (process.env.HUBOT_FORECAST_DAYS ? 'mon,tue,wed,thu,fri')
  .toLowerCase()
