Skip to Content
Scripts & Tools

Scripts & Tools

Utility scripts in scripts/, run with npx tsx.

WordPress scanners

ScriptCommandDescription
scan-wp-shortcodes.tsnpm run scanCrawls WordPress, extracts all [map ...] shortcodes
scan-wp-broken-tracks.tsnpx tsx scripts/scan-wp-broken-tracks.tsFinds shortcodes where the GPX file returns 404
scan-wp-track-intern.tsnpx tsx scripts/scan-wp-track-intern.tsFinds internal-only track references
scan-wp-demanam-track.tsnpx tsx scripts/scan-wp-demanam-track.tsFinds “demanam el track” pages

Waypoint corpus

Build a categorized corpus of GPX waypoints with emoji assignments:

npx tsx scripts/build-gpx-index.ts npx tsx scripts/build-waypoint-corpus.ts

The first script indexes GPX files from shortcode scan data. The second extracts waypoints, embeds names using Xenova/all-MiniLM-L6-v2, clusters via k-means, and assigns emoji categories using Catalan keyword heuristics.

See Waypoint Corpus for details.

Testing & validation

ScriptCommandDescription
test-tile-providers.tsnpm run tiles:checkValidates all tile layer URLs respond correctly
validate-posthog.tsnpx tsx scripts/validate-posthog.tsChecks PostHog environment configuration
test-waypoint-corpus.tsnpx tsx scripts/test-waypoint-corpus.tsValidates waypoint corpus output
test-analytics-events.tsnpx tsx scripts/test-analytics-events.tsValidates analytics event schema
test-cyclist-direction.tsnpx tsx scripts/test-cyclist-direction.tsTests cyclist emoji direction logic

Output

Script outputs are saved to scripts/output/ (gitignored):

  • gpx-index.csv — GPX file index
  • waypoints.csv — Waypoint corpus with clusters and emojis
  • waypoint-clusters.json — Cluster summaries