diff --git a/bot/aqi.go b/bot/aqi.go index 74f274d..8efa63f 100644 --- a/bot/aqi.go +++ b/bot/aqi.go @@ -47,7 +47,7 @@ func (b *Bot) HandleAirQualityRequest(channelid string, postid string, message s zip4 := matches[1] apikey := os.Getenv("AIRNOW_API_KEY") - url := fmt.Sprintf("http://www.airnowapi.org/aq/observation/zipCode/current/?format=application/json&zipCode=%d&distance=25&API_KEY=%s", zip4, apikey) + url := fmt.Sprintf("http://www.airnowapi.org/aq/observation/zipCode/current/?format=application/json&zipCode=%s&distance=25&API_KEY=%s", zip4, apikey) log.Info().Msgf("calculated url: `%s`", url) @@ -71,7 +71,7 @@ func (b *Bot) HandleAirQualityRequest(channelid string, postid string, message s var parsedAQIResponse AQIResponse - log.Info().Msgf("aqi %s: %s", zip, data) + log.Info().Msgf("aqi %s: %s", zip4, data) err = nil err = json.Unmarshal([]byte(data), &parsedAQIResponse) @@ -80,5 +80,5 @@ func (b *Bot) HandleAirQualityRequest(channelid string, postid string, message s b.SendMsgToChannel("error deserializing AQI data", postid, channelid) return } - b.SendMsgToChannel(fmt.Sprintf("AQI for `%s`: \n```\n%+v\n```\n", loc, parsedAQIResponse), postid, channelid) + b.SendMsgToChannel(fmt.Sprintf("AQI for `%s`: \n```\n%+v\n```\n", zip4, parsedAQIResponse), postid, channelid) }