feat: add Game8 parser with Genshin and NTE adapters
Parsers are keyed by site template, not game: one Game8 parser serves every Game8 page, and adapters bind a URL and game to a parser. Adding a source for a known site is one SOURCES entry. Game8 uses at least three templates. This handles label/value detail tables (Genshin, 9 events) and column tables (NTE, 13 events). Its image-grid schedule has no year and no end date, so Arknights: Endfield is not supportable from that source and gets no adapter. canParse is a structural tripwire: a site redesign fails the run loudly instead of publishing an empty calendar that reads as "no events". Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
caefe6b0d7
commit
489ce92ef5
@@ -0,0 +1,16 @@
|
||||
import { game8Parser } from "./game8.ts";
|
||||
import type { SourceParser } from "./types.ts";
|
||||
|
||||
/**
|
||||
* Every known site template. Adding a source for a site already listed here is
|
||||
* an entry in `adapters/index.ts`; adding a new *site* means a parser module
|
||||
* here and one line below.
|
||||
*/
|
||||
export const PARSERS: SourceParser[] = [game8Parser];
|
||||
|
||||
export function parserById(id: string): SourceParser | undefined {
|
||||
return PARSERS.find((p) => p.id === id);
|
||||
}
|
||||
|
||||
export type { SourceParser } from "./types.ts";
|
||||
export { game8Parser } from "./game8.ts";
|
||||
Reference in New Issue
Block a user