diff --git a/README.md b/README.md new file mode 100644 index 0000000..253b37c --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# uvgo + +This application downloads and parses the latest UV data from BfS (Bundesamt für Strahlenschutz). +This data is then displayed on a simple web UI. + +All UV data copyright belongs to BfS. diff --git a/main.go b/main.go index c01e985..6d5ebeb 100644 --- a/main.go +++ b/main.go @@ -98,8 +98,6 @@ func getUV(img image.Image) (vals []float64) { return } -var listen string - var tmp = ` @@ -114,10 +112,15 @@ a, a:link, a:visited {
UV Index
-

%s

-
Updated: %s
-
Server: %s
-
Location: %s
+

%s

+
Updated: %s
+
Server: %s
+
Location: %s
+
` @@ -149,7 +152,11 @@ func getColor(v float64) string { return "000000" } -var locPage = "" +var ( + locPage string + version string + listen string +) func main() { flag.StringVar(&listen, "l", ":7878", "listen addr") @@ -204,13 +211,13 @@ func main() { mod = mod.Local() location := selectListReverse[loc] if err != nil { - fmt.Fprintf(w, tmp, "000000", "Err", mod.Format(time.RFC1123), time.Now().Format(time.RFC1123), location, + version, ) return } @@ -222,6 +229,7 @@ func main() { mod.Format(time.RFC1123), time.Now().Format(time.RFC1123), location, + version, ) return } @@ -232,6 +240,7 @@ func main() { mod.Format(time.RFC1123), time.Now().Format(time.RFC1123), location, + version, ) }) err := http.ListenAndServe(listen, nil)