~ecs/quaternia

327f547e17db89bff23fdcf224bab456fab06bf4 — Eyal Sawady 12 days ago 6010842 master
s/Fahrenheit/Celsius/
1 files changed, 4 insertions(+), 4 deletions(-)

M wttr.go
M wttr.go => wttr.go +4 -4
@@ 88,7 88,7 @@ func (wttr) Output(args []string, f Flags, c *girc.Client, e girc.Event, ch chan

	if math.Abs(time.Now().Sub(when).Minutes()) < 1 {
		// TODO: make units configurable
		w, err := owm.NewCurrent("f", "en", GetConfig(c).OWMKey)
		w, err := owm.NewCurrent("c", "en", GetConfig(c).OWMKey)
		if err != nil {
			ch <- "error initializing API: " + err.Error()
			return


@@ 102,11 102,11 @@ func (wttr) Output(args []string, f Flags, c *girc.Client, e girc.Event, ch chan
		for _, weather := range w.Weather {
			desc = desc + weather.Description
		}
		ch <- fmt.Sprintf("weather in %s: %s, %.2f°F", name, desc,
		ch <- fmt.Sprintf("weather in %s: %s, %.2f°C", name, desc,
			w.Main.Temp)
		return
	}
	fc, err := owm.NewForecast("5", "f", "en", GetConfig(c).OWMKey)
	fc, err := owm.NewForecast("5", "c", "en", GetConfig(c).OWMKey)
	if err != nil {
		ch <- err.Error()
		return


@@ 127,7 127,7 @@ func (wttr) Output(args []string, f Flags, c *girc.Client, e girc.Event, ch chan
	for _, weather := range w.Weather {
		desc = desc + weather.Description
	}
	ch <- fmt.Sprintf("weather in %s at %s: %s, %.2f°F", name,
	ch <- fmt.Sprintf("weather in %s at %s: %s, %.2f°C", name,
		when.Format(time.RFC1123Z), desc, w.Main.Temp)
}