Newest
AQI Alerts
Get email alerts when AQI is unhealthy near you.
This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
A Go http handler running in Val Town:
Using this go source file, this go library, this Deno library, and this script. Image rendering is happening here. Mandelbrot rendering code taken from here.
Blog post, libraries with readmes and more info coming!
package main
import (
"fmt"
"net/http"
gotown "github.com/maxmcd/go-town"
)
func main() {
img := renderImage()
gotown.ListenAndServe(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/mandelbrot.png" {
w.Header().Set("Content-Type", "image/png")
w.Write(img)
return
}
w.Header().Set("Content-Type", "text/html")
fmt.Fprintf(w, `
<head><link rel="icon" href="/mandelbrot.png"></head>
<style>body {font-family: sans-serif}</style>
Go-Rendered mandelbrot image served from a Go HTTP handler <a href="https://www.val.town/v/maxm/tinygoHttpExample">on Val Town</a>
<br /><img src='/mandelbrot.png' />
`)
}))
}
AQI Alerts
Get email alerts when AQI is unhealthy near you.
Set up
- Click
Fork
- Change
location
(Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API. - Click
Run
Background
This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI