mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
fix(jobdanmark-search): drop presentation-only keys from search output
coverImage, companyLogo, companyLogoSvgMarkup, overlayColor, and silhouetteLogo were ~40% of a live payload - image keys, focal points and overlay colours an agent can never act on, paid into context on every /scrape query. A live 30-result response drops from ~30k to ~20k chars. The #340 compatibility duplicates and slug (the detail command's input) are kept deliberately. Review finding F3 (2026-08-19), decision approved by Mads. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
48965960d3
commit
56f679e5c0
@@ -129,13 +129,6 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10
|
||||
{
|
||||
"title": "IT-chef søges til RAH",
|
||||
"companyName": "Rah Service A/S",
|
||||
"companyLogo": {
|
||||
"key": "71f1c950-abcd-1234-efgh-000000000000",
|
||||
"url": "https://jobdanmark.dk/media/k1epc2kk/rah-service-logo.jpg",
|
||||
"focalPoint": null
|
||||
},
|
||||
"companyLogoSvgMarkup": null,
|
||||
"overlayColor": "#FFFFFF1F",
|
||||
"companyAddress": "Ndr Ringvej 4 6950 Ringkøbing",
|
||||
"jobTypes": ["fuldtid"],
|
||||
"boostJob": true,
|
||||
@@ -143,12 +136,6 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10
|
||||
"applicationDeadline": "10-04-2026",
|
||||
"url": "https://jobdanmark.dk/job/it-chef-soeges-til-rah",
|
||||
"slug": "it-chef-soeges-til-rah",
|
||||
"coverImage": {
|
||||
"key": "cf06eb46-abcd-1234-efgh-000000000000",
|
||||
"url": "https://jobdanmark.dk/media/idvbnt4y/rah-service-as-billede.png",
|
||||
"focalPoint": { "top": 0.488, "left": 0.499 }
|
||||
},
|
||||
"silhouetteLogo": false,
|
||||
"company": "Rah Service A/S",
|
||||
"location": "Ringkøbing",
|
||||
"date": "2026-03-12",
|
||||
@@ -162,9 +149,8 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10
|
||||
> - `url` is normalized to a full URL (CLI prepends `https://jobdanmark.dk` to the relative path from the API).
|
||||
> - `slug` is extracted from the relative `url` field (the path segment after `/job/`).
|
||||
> - `applicationDeadline` can be `null`.
|
||||
> - `companyLogo` can be `null`.
|
||||
> - `publishedDate` format: `"DD-MM-YYYY"`.
|
||||
> - `coverImage` can be `null`.
|
||||
> - Presentation-only keys the API sends (`coverImage`, `companyLogo`, `companyLogoSvgMarkup`, `overlayColor`, `silhouetteLogo`) are dropped from search output — they were ~40% of a live payload and an agent can never use them.
|
||||
> - Every result also carries the cross-portal contract fields `company`, `location`, `date` and `deadline`, derived from `companyName`, the city after the postal code in `companyAddress`, and the day-first dates converted to `YYYY-MM-DD` — `/scrape` Step 2 expects search output to include title, company, location, date, and URL. Native fields are preserved unchanged.
|
||||
|
||||
---
|
||||
@@ -454,5 +440,4 @@ All errors are written to **stderr** in JSON format and exit with code `1`:
|
||||
## URL construction
|
||||
|
||||
- Job detail pages: `https://jobdanmark.dk/job/{slug}`
|
||||
- Company logo images: `https://jobdanmark.dk{companyLogo.url}` (prepend base URL to relative path)
|
||||
- Cover images: `https://jobdanmark.dk{coverImage.url}` (prepend base URL to relative path)
|
||||
- Image URLs from the raw API (`companyLogo.url`, `coverImage.url`) are relative; prepend `https://jobdanmark.dk` if you consume the API directly (the CLI drops these keys)
|
||||
|
||||
Reference in New Issue
Block a user