diff --git a/.agents/skills/jobindex-search/SKILL.md b/.agents/skills/jobindex-search/SKILL.md index 9a2a1588..6169da1b 100644 --- a/.agents/skills/jobindex-search/SKILL.md +++ b/.agents/skills/jobindex-search/SKILL.md @@ -41,11 +41,11 @@ Invoke this skill when the user wants to: ### Search job listings ```bash -bun run .agents/skills/jobindex-search/cli/src/cli.ts search [flags] +bun run .agents/skills/jobindex-search/cli/src/cli.ts search --query "" [flags] ``` Key flags: -- `--query ` / `-q ` — keyword search (job title, skill, company, city). **Required** for meaningful results. +- `--query ` / `-q ` — keyword search (job title, skill, company, city). **Required.** Searches without a query exit with `MISSING_REQUIRED`. - `--jobage ` — filter by posting age: `1` (today), `7`, `14`, `30`, or `9999` (all, default) - `--sort ` — `score` (relevance, default) or `date` (newest first) - `--page ` — page number (1-indexed, 20 results per page, fixed) @@ -121,10 +121,11 @@ bun run .agents/skills/jobindex-search/cli/src/cli.ts search \ --format json ``` -### Jobs posted today across all sectors +### Jobs posted today for a keyword ```bash bun run .agents/skills/jobindex-search/cli/src/cli.ts search \ + --query python \ --jobage 1 \ --sort date \ --limit 20 \ @@ -167,5 +168,5 @@ All errors are written to **stderr** as `{ "error": "...", "code": "..." }` and - Page size is fixed at 20 results per page (Jobindex API limitation). - Area/region filtering via API params does not work — include city names in `--query` instead. - `--jobage 9999` is the default and includes all postings regardless of age. -- Total count in `meta.total` uses Danish dot-thousands notation internally (e.g. `18.903`) — the CLI normalizes this to a plain integer. +- Total count in `meta.total` comes from the numeric `searchResponse.hitcount` embedded in the search page. - Job IDs are string-prefixed (e.g. `h1647303`) — pass them as-is to `detail`. diff --git a/.agents/skills/jobindex-search/cli/README.md b/.agents/skills/jobindex-search/cli/README.md index 42713322..b24bb94f 100644 --- a/.agents/skills/jobindex-search/cli/README.md +++ b/.agents/skills/jobindex-search/cli/README.md @@ -4,7 +4,7 @@ CLI for searching jobs on [Jobindex.dk](https://www.jobindex.dk). **Base URL**: `https://www.jobindex.dk/` **Authentication**: None required. -**Format**: The API returns JSON with embedded HTML blobs. The CLI parses the HTML internally and emits clean JSON. +**Format**: The search HTML embeds a JSON `Stash` payload. The CLI extracts its structured search results and emits JSON, table, or plain output. --- @@ -31,19 +31,19 @@ All errors are written to **stderr** as `{ "error": "...", "code": "..." }` and ## `search` — Search for job listings -**Endpoint**: `GET https://www.jobindex.dk/jobsoegning.json` +**Endpoint**: `GET https://www.jobindex.dk/jobsoegning` ```bash -bun run src/cli.ts search [flags] +bun run src/cli.ts search --query "" [flags] ``` -The API always returns 20 results per page (fixed — no `--per-page` flag). The CLI parses the `result_list_box_html` HTML blob from the response to extract structured job records. +The portal returns 20 results per page (fixed — no `--per-page` flag). The CLI reads `searchResponse.results` from the page's `var Stash = {...}` script. `--query` is required; a query-free search exits with `MISSING_REQUIRED` before fetching. ### Flags | Flag | Type | Default | Description | |------|------|---------|-------------| -| `--query` / `-q` | string | — | Keyword search query (e.g. `python`, `grafisk designer`) | +| `--query` / `-q` | string | — | **Required.** Keyword search query (e.g. `python`, `grafisk designer`) | | `--page` | number | `1` | Page number (1-indexed) | | `--jobage` | number | `9999` | Max age of posting in days: `1`, `7`, `14`, `30`, or `9999` (all) | | `--sort` | string | `score` | Sort order: `score` (relevance) or `date` (newest first) | @@ -97,8 +97,9 @@ bun run src/cli.ts search --query "data engineer" --page 2 --format table "companyUrl": "https://www.gavefabrikken.dk/", "location": "Valby", "date": "2026-03-12", - "url": "https://www.jobindex.dk/jobannonce/h1647303/data-engineer-til-opbygning-af-gavefabrikkens-dataplatform", - "description": "Vi søger en dygtig Data Engineer til at opbygge og vedligeholde vores dataplatform..." + "deadline": "2026-04-01", + "url": "https://www.jobindex.dk/jobannonce/h1647303", + "description": null } ] } @@ -109,10 +110,11 @@ bun run src/cli.ts search --query "data engineer" --page 2 --format table - `company` — company name; may be `null` for some aggregated listings. - `companyUrl` — company homepage URL; may be `null` if not present. - `location` — city or area; may be `null` if not listed. -- `date` — ISO date string (`YYYY-MM-DD`) from the `datetime` attribute on the `