 #
 # Configuration:
 #   HUBOT_FORECAST_KEY
+#   HUBOT_LAT_LNG
 #
 # Commands:
 #   none


  fetchForecast = (callback) ->

    location = 'LAT,LNG'
    forecastKey = process.env.HUBOT_FORECAST_KEY
    exclude = 'hourly,daily,flags'

    base_url = "https://api.forecast.io/forecast/#{forecastKey}/#{location}"
    url = "#{base_url}?units=us&exclude=#{exclude}"

    console.log "[Forecast] Requesting forecast data: #{url}"

    _delay = "#{Math.round(delta / 60 / 1000)}"

    _now = new Date().getTime()
    _link = "http://forecast.io/#/f/#{LOCATION}/#{Math.round(_now / 1000)}"

    msg = "WEATHER: #{_percent}% chance of inclement weather in the next hour for at least #{_minutes} minutes. It will be worst in #{_delay} minutes (#{_intensity} precipitation). #{_link}"

