From 10510c53221a3acb6d8e7ae966b5fe3d399ed50a Mon Sep 17 00:00:00 2001 From: ston1th Date: Sat, 12 Apr 2025 21:52:56 +0200 Subject: [PATCH] added disclaimer --- README.md | 6 ++++++ main.go | 25 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 README.md 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)