 #   None
 #
 # Configuration:
+#   HUBOT_OPEN_WEATHER_MAP_APIKEY = required API key from http://openweathermap.org/faq#error401
 #   HUBOT_OPEN_WEATHER_MAP_URL (optional)
 #   HUBOT_OPEN_WEATHER_MAP_DEFAULT_CITIES (optional)
 #

        weatherFor(msg, city)

  weatherFor = (msg, input) ->
    robot.http(weatherURL + input)
      .get() (err, res, body) ->
        json = JSON.parse body
        msg.send "It is currently #{kelvinToFahrenheit json.main.temp}°F in #{json.name}."

#
# Author:
#   github.com/TrevorS
#   github.com/endodino

weatherURL = process.env.HUBOT_OPEN_WEATHER_MAP_URL or 'http://api.openweathermap.org/data/2.5/weather?q='
cities     = process.env.HUBOT_OPEN_WEATHER_MAP_DEFAULT_CITIES
apiKey = process.env.HUBOT_OPEN_WEATHER_MAP_APIKEY

module.exports = (robot) ->
  robot.respond /weather help$/i, (msg) ->
