mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 08:36:25 +00:00
fix(linkedin-search): drop the never-delivered applyUrl detail field
The regex required class= before href= within one tag; LinkedIn's real markup puts href first, so applyUrl was null on every live posting while SKILL.md claimed the command returns an apply link. Fixing the regex would only yield the job-view URL - a duplicate of url - so the field is removed rather than repaired, and a test pins the removal. Review finding F19 (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
56f679e5c0
commit
a306912133
@@ -43,7 +43,6 @@ export async function runDetail(opts: DetailOpts): Promise<number> {
|
||||
job.description || "(no description)",
|
||||
"",
|
||||
`URL: ${job.url}`,
|
||||
job.applyUrl ? `Apply: ${job.applyUrl}` : "",
|
||||
].filter((l) => l !== "")
|
||||
process.stdout.write(lines.join("\n") + "\n")
|
||||
} else {
|
||||
|
||||
@@ -63,7 +63,6 @@ export interface JobDetail extends JobCard {
|
||||
employmentType: string | null
|
||||
jobFunction: string | null
|
||||
industries: string | null
|
||||
applyUrl: string | null
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,9 +227,6 @@ export function parseJobDetail(html: string, id: string): JobDetail {
|
||||
criteria[clean(cm[1]).toLowerCase()] = clean(cm[2])
|
||||
}
|
||||
|
||||
const applyMatch = html.match(/class="topcard__link[^"]*"[^>]*href="([^"]+)"/i)
|
||||
const applyUrl = applyMatch ? decodeHtmlEntities(applyMatch[1]).split("?")[0] : null
|
||||
|
||||
return {
|
||||
id,
|
||||
title: title ? clean(title) : "(untitled)",
|
||||
@@ -244,7 +240,6 @@ export function parseJobDetail(html: string, id: string): JobDetail {
|
||||
employmentType: criteria["employment type"] ?? null,
|
||||
jobFunction: criteria["job function"] ?? null,
|
||||
industries: criteria["industries"] ?? null,
|
||||
applyUrl,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user