1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Displays Github review requests and PRs

This commit is contained in:
Chris Cummer
2018-04-05 10:05:05 -07:00
committed by Chris Cummer
parent 32b395a19e
commit fb637700b1
12 changed files with 168 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
package weather
import (
//"fmt"
"os"
owm "github.com/briandowns/openweathermap"

View File

@@ -70,9 +70,16 @@ func (widget *Widget) contentFrom(data *owm.CurrentWeatherData) string {
tempUnit := Config.UString("wtf.weather.tempUnit", "C")
str = str + fmt.Sprintf("%10s: %4.1f° %s\n", "Current", data.Main.Temp, tempUnit)
str = str + fmt.Sprintf("%10s: %4.1f° %s\n", "High", data.Main.TempMax, tempUnit)
str = str + fmt.Sprintf("%10s: %4.1f° %s\n", "Low", data.Main.TempMin, tempUnit)
str = str + fmt.Sprintf("%8s: %4.1f° %s\n", "High", data.Main.TempMax, tempUnit)
str = str + fmt.Sprintf("%8s: [yellow]%4.1f° %s[white]\n", "Current", data.Main.Temp, tempUnit)
str = str + fmt.Sprintf("%8s: %4.1f° %s\n", "Low", data.Main.TempMin, tempUnit)
str = str + "\n"
str = str + fmt.Sprintf(
" Sunrise: %s Sunset: %s\n",
wtf.UnixTime(int64(data.Sys.Sunrise)).Format("15:04"),
wtf.UnixTime(int64(data.Sys.Sunset)).Format("15:04"),
)
return str
}