house tracker: CLI to add, update, list and remove listings by hand
scripts/house-listing.ts (bun run house add|update|list|remove|restore) upserts house.listings on (source, source_id) derived from the listing URL or address, derives city_slug, records price_history, and accepts flags or JSON.
This commit is contained in:
@@ -176,3 +176,29 @@ fixture still covers pagination and price on request. Rental `priceEur` is the
|
||||
base/listed rent used by the search filter; a separately shown total can be
|
||||
higher (Raam: €1,475 base, €1,750 total). If Pararius changes markup, the worker
|
||||
reports `parse-error` in the worker log on the page.
|
||||
|
||||
## Adding listings by hand
|
||||
|
||||
`scripts/house-listing.ts` writes `house.listings` directly (links from chats,
|
||||
screenshots). No restart or deploy is needed for new rows.
|
||||
|
||||
```sh
|
||||
# DATABASE_URL or DB_URL must be set; locally: bun --env-file=.env run house …
|
||||
bun run house add --url https://vbtverhuurmakelaars.nl/woning/gouda-vest-7-d \
|
||||
--city Gouda --price "€ 1.422,- p.m." --area 84 --rooms 3 --bedrooms 2 --energy-label A
|
||||
echo '{"url":"…","city":"Gouda","price_eur":1350,"area_m2":81}' | bun run house add --json -
|
||||
bun run house add --street "Vest 7-D" --city Gouda --price 1422 # no link (screenshot)
|
||||
bun run house update <id|url> --status viewing --notes "za 14:00" # "" clears a field
|
||||
bun run house list [--all] [--city gouda] [--offer buy] [--json]
|
||||
bun run house remove <id|url> [--hard] # soft remove marks it gone; restore undoes it
|
||||
```
|
||||
|
||||
- `source` is the site (`funda`, `pararius`, `vbt`, `vesteda`, … or `manual`
|
||||
without a link); `source_id` comes from the URL (Funda's number, Pararius'
|
||||
worker key, otherwise the path), or a hash of the address. Adding the same
|
||||
link again updates that row and clears `removed_at`.
|
||||
- Fields follow `listingDetailSchema` (camelCase, snake_case or the flag names)
|
||||
and are lenient: "€ 1.422,- p.m." and "84 m²" are parsed. Only given fields are
|
||||
written. `city_slug` is derived from `city` in Pararius' slug style.
|
||||
- `--first-seen` sets when it was shared; price changes go to `price_history`.
|
||||
- Manual rows use `first_seen_lane = 'manual'` and never trigger alerts.
|
||||
|
||||
Reference in New Issue
Block a user