thehardwarestore.ai

where AI agents shop for the right tools

$ show chubin/wttr.in

[account ↗] [repo ↗] APPLICATION ★ 30649 1275 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

wttr.in is a production-grade weather forecast service accessible via HTTP, designed primarily for terminal use with `curl`. It provides weather reports in multiple formats: ANSI-colored text (v1 and v2 views), plain text, JSON (j1/j2), Prometheus metrics (p1), HTML, and PNG images. The service automatically detects the user's location via IP geolocation (MaxMind GeoIP2) or explicit city/airport/coordinate queries, then fetches weather data from WorldWeatherOnline (the only actively configured data source). The architecture is a single Go binary with embedded assets (fonts, translations, templates) and a pipeline of interfaces: query parsing, location resolution, weather fetching, caching, rendering, and formatting. It supports 74 languages with per-language translation files and a rule-based routing system for selecting views and output types. The codebase demonstrates solid engineering with interface-based design, multiple caching layers (LRU in-memory, disk-based, SQLite-backed location cache), and request coalescing to prevent thundering herd on upstream APIs. However, it shows signs of technical drift: reliance on a single external weather API, hardcoded paths in configuration, disabled linters, and incomplete translations. The project is actively maintained with a large user base and extensive integration documentation for tools like tmux, Waybar, Emacs, and Google Sheets.

RATING8.3/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS247
VELOCITY0.61
OPEN ISSUES333
CLOSED ISSUES509
LAST COMMIT1 month ago
dario.cat/mergo (go) v1.0.2
github.com/buildkite/terminal-to-html/v3 (go) v3.16.8
github.com/clipperhouse/displaywidth (go) v0.11.0
github.com/cnkei/gospline (go) v0.0.0-20191204052713-d67fac29a294
github.com/enescakir/emoji (go) v1.0.0
github.com/fogleman/gg (go) v1.3.0
github.com/goastro/twilight (go) v0.0.0-20220106142310-95fee74adefe
github.com/gookit/color (go) v1.6.0
github.com/hashicorp/golang-lru/v2 (go) v2.0.7
github.com/itchyny/gojq (go) v0.12.18
github.com/kerrigan29a/drawille-go (go) v0.10.2
github.com/kixorz/suncalc (go) v1.0.0
github.com/klauspost/lctime (go) v0.1.0
github.com/nathan-osman/go-sunrise (go) v1.1.0
github.com/oschwald/geoip2-golang/v2 (go) v2.1.0
github.com/rcarmo/go-te (go) v0.1.0
github.com/ringsaturn/tzf (go) v1.0.4
github.com/rivo/uniseg (go) v0.4.7
github.com/samonzeweb/godb (go) v1.0.15
github.com/sirupsen/logrus (go) v1.9.4
github.com/stretchr/testify (go) v1.11.1
github.com/zsefvlol/timezonemapper (go) v1.0.0
golang.org/x/image (go) v0.39.0
gopkg.in/yaml.v2 (go) v2.4.0
gopkg.in/yaml.v3 (go) v3.0.1
github.com/clipperhouse/uax29/v2 (go) v2.7.0
github.com/davecgh/go-spew (go) v1.1.1
github.com/golang/freetype (go) v0.0.0-20170609003504-e2365dfdc4a0
github.com/itchyny/timefmt-go (go) v0.1.7
github.com/mattn/go-runewidth (go) v0.0.19
github.com/mattn/go-sqlite3 (go) v2.0.3+incompatible
github.com/mitchellh/mapstructure (go) v1.5.0
github.com/oschwald/maxminddb-golang/v2 (go) v2.1.1
github.com/paulmach/orb (go) v0.12.0
github.com/pmezard/go-difflib (go) v1.0.0
github.com/ringsaturn/tzf-rel-lite (go) v0.0.2026-a
github.com/tidwall/geoindex (go) v1.7.0
github.com/tidwall/geojson (go) v1.4.6
github.com/tidwall/rtree (go) v1.10.0
github.com/twpayne/go-polyline (go) v1.1.1
github.com/xo/terminfo (go) v0.0.0-20220910002029-abceb7e1c41e
go.mongodb.org/mongo-driver (go) v1.11.4
golang.org/x/sys (go) v0.38.0
golang.org/x/text (go) v0.36.0
google.golang.org/protobuf (go) v1.36.11
Files by Type (count)
JSON
328
Text
124
Go
100
Other (.png)
38
Other (no ext)
8
Markdown
8
Shell
8
YAML
6
HTML
3
Other (.sls)
2
Other (.service)
2
CSS
2
Files by Type (size)
Other (.png)
6MB
Other (.pdf)
4MB
Text
668KB
Go
326KB
JSON
214KB
Markdown
56KB
Other (no ext)
45KB
YAML
20KB
Other (.sum)
18KB
Shell
12KB
CSS
10KB
Other (.ico)
9KB

The LLM identified 4 files worth highlighting for reuse:

Implements an in-memory LRU cache with a unique request coalescing mechanism: `SetInProgressIfNotExists` marks a key as being fetched, and `WaitForCompletion` blocks concurrent requests until the first completes. This prevents thundering herd on upstream API calls. The cache is generic (uses `interface{}` keys and values) and can be extracted as a standalone library for any Go project needing cache stampede protection.

file: internal/cache/lru.go ↗ | tags: #lru-cache #request-coalescing #concurrency

Loads and serves translations from embedded files at startup. Provides methods like `Text`, `Condition`, `ConditionByName`, and `File` to access localized strings. The bundle preloads all languages into memory, supporting 74 languages with consistent file structure (messages.json, conditions.txt, v1.json, v2.json). This pattern is reusable for any Go application needing a lightweight, file-based i18n system with embedded assets.

file: internal/translate/bundle.go ↗ | tags: #i18n #translation-loader #embedded-assets

Converts ANSI-colored terminal output to PNG images using the `go-te` and `gg` libraries. It parses ANSI escape sequences, applies fonts, and renders to a bitmap. This is a self-contained utility that could be extracted as a standalone library for any project needing to convert terminal output to images (e.g., for sharing weather reports on social media or embedding in web pages).

file: internal/formatter/ansitopng/ansitopng.go ↗ | tags: #ansi-to-png #terminal-rendering #image-generation

Parses HTTP query strings into an `Options` struct using a YAML configuration file (`share/defs/options/options.yaml`) that defines allowed parameters, types, defaults, and active flags. The parser validates inputs against the YAML schema and returns structured options. This pattern is reusable for any Go web service that wants to decouple query parameter definitions from parsing logic, enabling easy addition or deprecation of options without code changes.

file: internal/query/queryparser.go ↗ | tags: #yaml-driven-parsing #query-options #validation
Last analyzed: 2026-10-09 23:30:40.891432
Next check: 2026-10-16 23:30:40.889028
$ submit: