MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / parseCmeSymbol

Function parseCmeSymbol

src/lib/resolutionSources.ts:57–71  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

55}
56
57function parseCmeSymbol(url: string): string | null {
58 // https://www.cmegroup.com/markets/energy/crude-oil/light-sweet-crude.settlements.html → CL
59 // https://www.cmegroup.com/markets/metals/precious/gold.settlements.html → GC
60 const CME_MAP: Record<string, string> = {
61 "light-sweet-crude": "CL=F",
62 "gold": "GC=F",
63 "silver": "SI=F",
64 "natural-gas": "NG=F",
65 "copper": "HG=F",
66 };
67 for (const [path, symbol] of Object.entries(CME_MAP)) {
68 if (url.includes(path)) return symbol;
69 }
70 return null;
71}
72
73// ── Phase 2: Sports domain → ESPN/BBC Sport RSS feed mapping ──
74

Callers 1

parseResolutionSourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected