Community and civic applications
NH Kids Events
Find things to do with your kids across New Hampshire.
The problem
Finding children’s and family activities across New Hampshire often means visiting dozens of individual library calendars, municipal recreation pages, museum schedules, and community websites that each publish events in different formats.
What I built
NH Kids Events is a modular event collection pipeline and server-side rendered community calendar built with TypeScript on Cloudflare Workers, Cloudflare D1, and Cloudflare Pages.
Key capabilities
- Runs scheduled daily source acquisition across configured local calendars using conditional HTTP requests (
ETagandIf-Modified-Since) and content hashing. - Parses listings through reusable source adapters for iCalendar (RFC 5545 with 60-day recurrence expansion), RSS/Atom feeds, WordPress The Events Calendar APIs, common library calendar platforms (Assabet, LibraryCalendar, EngagedPatrons, widget JSON, Wix Events), PDF/image flyers, and HTML pages (checking
schema.org/EventJSON-LD before falling back to Gemini-assisted extraction). - Classifies new or changed events with Google’s Gemini Decisions API to determine kids/family relevance, age group (
0–2,3–5,6–8,9–12,13–17, orAll Ages & Family), activity category, registration vs. drop-in status, cancellation hints, and extraction quality. - Routes confident matches directly to the live calendar, holds borderline items in a review queue, supports visitor issue reports and source suggestions, and uses an automatic circuit breaker so sources with repeated failures are flagged for inspection.
- Provides a searchable calendar with age, activity, and location filters, an organization directory, per-event
.icscalendar downloads, and an RSS feed (/feed.xml).
Technical architecture
Engineering decisions
A core engineering priority is skipping unchanged source material so the pipeline avoids unnecessary repeated AI processing. Volatile HTML boilerplate (<script>, <style>, <nav>, <footer>, and comments) is stripped before computing a SHA-256 hash so unchanged pages short-circuit before parsing. At the event layer, normalized deduplication keys (dedup_key) paired with content_hash skip events already stored unchanged in D1, and a per-run recurring-series cache avoids re-classifying identical recurring event instances.
Availability & notes
Dedicated website planned. NH Kids Events aggregates publicly published event listings and is not exhaustive; schedules change for weather, holidays, and full registration, so readers should always confirm details with the original organizer before attending.