2024-09-24 18:38:24 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2024-09-26 08:07:10 +00:00
|
|
|
"git.sr.ht/~timharek/yr-go"
|
2024-09-24 18:38:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-09-26 08:07:10 +00:00
|
|
|
y, err := yr.New()
|
2024-09-24 18:38:24 +00:00
|
|
|
if err != nil {
|
2024-09-26 08:07:10 +00:00
|
|
|
panic(err)
|
2024-09-24 18:38:24 +00:00
|
|
|
}
|
2024-09-26 08:07:10 +00:00
|
|
|
now, err := y.Now("bergen")
|
2024-09-24 18:38:24 +00:00
|
|
|
if err != nil {
|
2024-09-26 08:07:10 +00:00
|
|
|
panic(err)
|
2024-09-24 18:38:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-26 08:07:10 +00:00
|
|
|
fmt.Printf("Temp: %.4f\n", now.Temperature)
|
|
|
|
fmt.Printf("Rain: %.4f\n", now.Percipitation)
|
2024-09-24 18:38:24 +00:00
|
|
|
}
|