TypeScript/Node sitemap generator for DoomWiki using the MediaWiki API.
- Queries DoomWiki page metadata by namespace
- Queries image metadata (
allimages) - Emits namespace sitemap XML files
- Emits a sitemap index XML file
- Emits a JSON run summary
- Node.js 24+
- npm
npm installnpm run build
npm run start -- --out-dir output/run1node index.ts --out-dir output/run1--out-dir <path>: output directory (default:output)--max-pages <n>: cap pages per namespace (useful for test runs)--max-images <n>: cap total images fetched--sleep-ms <ms>: delay between continuation requests
Example bounded run:
node index.ts --max-pages 20 --max-images 20 --sleep-ms 250 --out-dir output/sampleFor each run, the generator writes:
main.xmltalk.xmluser.xmlutalk.xmldwiki.xmldwtalk.xmlfile.xmlftalk.xmlhelp.xmlhtalk.xmlcat.xmlctalk.xmlsitemap-index.xmlrun-summary.json
Each namespace file is a standard Sitemap XML document:
- root:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ...> - per page:
<url>with:<loc>canonical DoomWiki URL<lastmod>MediaWikitouchedtimestamp<changefreq>(weekly|monthly|yearlyheuristic)<priority>namespace/title heuristic
- optional image entries per page:
<image:image><image:loc>- optional
<image:title> - optional
<image:license>
sitemap-index.xml uses standard <sitemapindex> with one <sitemap> per namespace XML.
run-summary.json includes:
generatedAtelapsedMspageCountfilesoptions
The client is conservative by default (serialized requests) and also includes retry handling for transient API failures:
- Retries on HTTP
429,502,503 - Honors
Retry-Afterwhen present - Uses exponential backoff + jitter otherwise
If you want to further reduce request pressure, set --sleep-ms to a non-zero value.