chore(debug): TEMP dump Ford json-main-group raw JSON
This commit is contained in:
@@ -1807,22 +1807,12 @@ export class PL24FordLegacyService {
|
||||
this.logger.warn(
|
||||
`FORD-MAP nodes: ${JSON.stringify(groups.slice(0, 14).map((g) => ({ n: g.nameTr?.slice(0, 28), lp: g.linkPath?.slice(0, 90) })))}`,
|
||||
);
|
||||
// drill the first node and dump what comes back
|
||||
const first = groups[0];
|
||||
if (first?.linkPath) {
|
||||
const ch = await this.fetchP4Page(first.linkPath, serviceName, false);
|
||||
if (ch) {
|
||||
const rows: string[] = [];
|
||||
for (const seg of ch.split(/<tr\s/)) {
|
||||
if (!seg.includes("tc-data-row")) continue;
|
||||
const m = seg.match(/\burl="([^"]+)"/) || seg.match(/\bjsonUrl="([^"]+)"/i);
|
||||
const cap = seg.match(/\bcaption="([^"]+)"/)?.[1]?.slice(0, 24);
|
||||
rows.push(`${cap}::${(m?.[1] || "").slice(0, 50)}`);
|
||||
}
|
||||
this.logger.warn(
|
||||
`FORD-MAP drill "${first.nameTr?.slice(0, 24)}": len=${ch.length} title="${ch.match(/<title>([^<]*)<\/title>/i)?.[1]}" rows=${rows.length} ${JSON.stringify(rows.slice(0, 8))}`,
|
||||
);
|
||||
}
|
||||
// drill an ENGINE restriction node (json-main-group.action) and dump raw JSON
|
||||
const eng = groups.find((x) => /Diesel|Sigma|Zetec|GTDI|Fox/i.test(x.nameTr || "")) || groups[0];
|
||||
this.logger.warn(`FORD-MAP full linkPath: ${eng?.linkPath}`);
|
||||
if (eng?.linkPath) {
|
||||
const ch = await this.fetchP4Page(eng.linkPath, serviceName, false);
|
||||
this.logger.warn(`FORD-MAP drill "${eng.nameTr?.slice(0, 24)}" raw(1500): ${ch?.slice(0, 1500)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user