← back to La Socrata Ingester
chore: refactor (ERA_DAYS const, indent), minor version bump (session close)
f06221aa490638b5d9367fc2f0f4654cf3bdab03 · 2026-08-12 10:31:09 -0700 · Steve Abrams
Files touched
M package-lock.jsonM package.jsonM scripts/linkedin-openclaw.jsM scripts/permit-crew.js
Diff
commit f06221aa490638b5d9367fc2f0f4654cf3bdab03
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Aug 12 10:31:09 2026 -0700
chore: refactor (ERA_DAYS const, indent), minor version bump (session close)
---
package-lock.json | 4 ++--
package.json | 2 +-
scripts/linkedin-openclaw.js | 4 ++--
scripts/permit-crew.js | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 6b4c755..a1333ae 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "la-socrata-ingester",
- "version": "0.1.1",
+ "version": "0.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "la-socrata-ingester",
- "version": "0.1.1",
+ "version": "0.2.0",
"license": "UNLICENSED",
"dependencies": {
"express": "^5.2.1",
diff --git a/package.json b/package.json
index 8c05032..5e0c79e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "la-socrata-ingester",
- "version": "0.1.1",
+ "version": "0.2.0",
"description": "Programmatic ingester for LA public data (Socrata SODA + LA County ArcGIS FeatureServer) -> realestate Postgres. $0, free public APIs.",
"type": "module",
"bin": {
diff --git a/scripts/linkedin-openclaw.js b/scripts/linkedin-openclaw.js
index 1d713f1..ea53979 100644
--- a/scripts/linkedin-openclaw.js
+++ b/scripts/linkedin-openclaw.js
@@ -61,9 +61,9 @@ async function searchLinkedin(name, city) {
try { arr = unwrap(oc(`evaluate --target-id ${t} --fn ${JSON.stringify(EXTRACT_FN)}`)); } catch { arr = []; }
}
} finally { try { oc(`close --target-id ${t}`); } catch {} } // don't leak tabs
- const cands = [...new Set(arr.map(norm))]
+ const cands = [...new Set(arr.map(norm))]
.filter(u => !/\/pub\/dir\//i.test(u) && slugMatches(name, u)); // reject people-directory pages
- return cands.find(u => /\/company\//i.test(u)) || cands[0] || null; // prefer the company page
+ return cands.find(u => /\/company\//i.test(u)) || cands[0] || null; // prefer the company page
}
async function writeLic(lic, link) {
await q(`UPDATE cslb_raw SET linkedin=$2, linkedin_source='openclaw', contacts_enriched_at=COALESCE(contacts_enriched_at,now()) WHERE "LicenseNo"=$1`, [lic, link]);
diff --git a/scripts/permit-crew.js b/scripts/permit-crew.js
index 693f63d..e29a4d9 100644
--- a/scripts/permit-crew.js
+++ b/scripts/permit-crew.js
@@ -12,6 +12,7 @@ const kv = Object.fromEntries(process.argv.slice(2).filter(a => a.startsWith('--
const flags = process.argv.slice(2).filter(a => a.startsWith('--') && !a.includes('='));
const positional = process.argv.slice(2).filter(a => !a.startsWith('--')).join(' ').trim();
const DELAY = Number(process.env.CREW_DELAY_MS || 1500); // polite to city infra
+const ERA_DAYS = 550; // build-era window: permits within N days of anchor
const TRADE = { 'pi9x-tg5x': 'GC / Building', 'dyxf-7hc4': 'GC / Building', 'e67z-kt2n': 'GC / Building', 'ysqd-apz7': 'Electrical sub', '67is-svtd': 'Plumbing/Mech sub' };
const decode = s => String(s)
@@ -57,7 +58,7 @@ export async function getCrew(apn) {
FROM la_building_permits_raw WHERE apn=$1 AND issue_date IS NOT NULL ORDER BY issue_date DESC`, [apn])).rows;
const bldg = permits.filter(p => /pi9x|dyxf|e67z/.test(p.dataset_id));
const anchor = (bldg[0] || permits[0])?.issued;
- const eraStart = anchor ? new Date(new Date(anchor).getTime() - 550 * 86400 * 1000).toISOString().slice(0, 10) : '0000-01-01';
+ const eraStart = anchor ? new Date(new Date(anchor).getTime() - ERA_DAYS * 86400 * 1000).toISOString().slice(0, 10) : '0000-01-01';
const era = permits.filter(p => p.issued >= eraStart);
const seen = new Set(), roleByName = {}, crew = [];
for (const p of era) {
← 952a377 property.js: one command → property + crew + each member's L
·
back to La Socrata Ingester
·
add rentv LinkedIn enricher via openclaw (dedup by firm, pri d2328d9 →