Scripts & Tools
Utility scripts in scripts/, run with npx tsx.
WordPress scanners
| Script | Command | Description |
|---|---|---|
scan-wp-shortcodes.ts | npm run scan | Crawls WordPress, extracts all [map ...] shortcodes |
scan-wp-broken-tracks.ts | npx tsx scripts/scan-wp-broken-tracks.ts | Finds shortcodes where the GPX file returns 404 |
scan-wp-track-intern.ts | npx tsx scripts/scan-wp-track-intern.ts | Finds internal-only track references |
scan-wp-demanam-track.ts | npx tsx scripts/scan-wp-demanam-track.ts | Finds “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.tsThe 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
| Script | Command | Description |
|---|---|---|
test-tile-providers.ts | npm run tiles:check | Validates all tile layer URLs respond correctly |
validate-posthog.ts | npx tsx scripts/validate-posthog.ts | Checks PostHog environment configuration |
test-waypoint-corpus.ts | npx tsx scripts/test-waypoint-corpus.ts | Validates waypoint corpus output |
test-analytics-events.ts | npx tsx scripts/test-analytics-events.ts | Validates analytics event schema |
test-cyclist-direction.ts | npx tsx scripts/test-cyclist-direction.ts | Tests cyclist emoji direction logic |
Output
Script outputs are saved to scripts/output/ (gitignored):
gpx-index.csv— GPX file indexwaypoints.csv— Waypoint corpus with clusters and emojiswaypoint-clusters.json— Cluster summaries