added disclaimer
This commit is contained in:
parent
b6c5e09026
commit
10510c5322
2 changed files with 23 additions and 8 deletions
6
README.md
Normal file
6
README.md
Normal file
|
|
@ -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.
|
||||
25
main.go
25
main.go
|
|
@ -98,8 +98,6 @@ func getUV(img image.Image) (vals []float64) {
|
|||
return
|
||||
}
|
||||
|
||||
var listen string
|
||||
|
||||
var tmp = `<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -114,10 +112,15 @@ a, a:link, a:visited {
|
|||
<body style="background-color:#d6d6d6;">
|
||||
<center>
|
||||
<h5 style="font-size:4em;">UV Index</h5>
|
||||
<h1 style="font-size:18em;color:#%s;">%s</h1>
|
||||
<h5 style="font-size:4em;">Updated: %s</h5>
|
||||
<h5 style="font-size:4em;">Server: %s</h5>
|
||||
<h5 style="font-size:4em;"><a href="/set">Location</a>: %s</h5>
|
||||
<h1 style="font-size:15em;color:#%s;">%s</h1>
|
||||
<h5 style="font-size:2em;">Updated: %s</h5>
|
||||
<h5 style="font-size:2em;">Server: %s</h5>
|
||||
<h5 style="font-size:3em;"><a href="/set">Location</a>: %s</h5>
|
||||
<footer>UV data copyright belongs to <a href="https://www.bfs.de/DE/themen/opt/uv/uv-index/aktuelle-tagesverlaeufe/aktuell_node.html" rel="nofollow noreferrer noopener" target="_blank">Bundesamt für Strahlenschutz</a><br>
|
||||
Use this service at your own risk.<br>
|
||||
I take no responsibility for missing or incorrect data.<br>
|
||||
© <a href="https://git.giftfish.de/ston1th/uvgo" rel="nofollow noreferrer noopener" target="_blank">uvgo</a> %s<br><br>
|
||||
</footer>
|
||||
</center>
|
||||
</body>
|
||||
</html>`
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue