Use Zillow parcel hints for CAD lookup

This commit is contained in:
2026-03-28 03:55:56 -05:00
parent ece8fc548f
commit b77134ced5
11 changed files with 438 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
import {
extractZillowStructuredPhotoCandidatesFromNextDataScript,
extractZillowIdentifierHintsFromNextDataScript,
shouldUseStructuredZillowPhotos,
} from "./zillow-photo-data.js";
@@ -119,3 +120,27 @@ test("shouldUseStructuredZillowPhotos returns false for a tiny structured set wh
false
);
});
test("extractZillowIdentifierHintsFromNextDataScript finds parcel and APN style identifiers", () => {
const scriptText = JSON.stringify({
props: {
pageProps: {
componentProps: {
gdpClientCache: JSON.stringify({
SomeQuery: {
property: {
parcelId: "1234567890",
apn: "APN-77-55",
},
},
}),
},
},
},
});
assert.deepEqual(extractZillowIdentifierHintsFromNextDataScript(scriptText), {
parcelId: "1234567890",
apn: "APN-77-55",
});
});