A European seed of 362 employers, readable or not; discover finds a company's board from its site
The seed was jobhunt-hq's 186 US boards, chosen because they could be read. It is now a hand-picked list of European tech employers, with `board` filled by the new `app.jobs.discover` from each company's own careers site and every board fetched once before it landed: 175 have one, and the rest keep the ATS host their site runs on (Teamtailor 32, Workday 12, SuccessFactors 9, ...) and a careers URL, as rows the app cannot read yet. Companies shows them as "not readable yet" with a link, behind a filter, so the next parser to write is the host that filter shows most. `app companies discover NAME DOMAIN [--add]` reads the home page, its careers links and the usual paths for a link into a known host, one level down on a careers page, and probes Greenhouse, Lever, Ashby, SmartRecruiters, Recruitee and Personio by slug when the pages link nothing. It is what the LinkedIn flow will call. Migration 7 adds companies.ats, country and city. The Workable parser now reads the v3 shape its list endpoint actually sends (location object, department list, shortcode and no URL or text); the first populated board showed it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4f2bcc0c9
commit
51d1e67ff9
19 files changed
+3362
-1394
No files matched your search
+26
-1
@@ -11,13 +11,16 @@ roles; switched back on, the next pull reopens every role it still lists.
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from app.config import Config
|
||||
from app.models import EUROPE, Subscription, company_key
|
||||
from app.storage import Store
|
||||
from app.jobs.pull import search_target
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.jobs.discover import Discovery
|
||||
|
||||
#: The providers `plugins.search` runs, and which of them needs a key.
|
||||
PROVIDERS = ("jobindex", "adzuna")
|
||||
|
||||
@@ -91,6 +94,28 @@ def add_board(store: Store, board: str, name: str) -> tuple[Subscription, int]:
|
||||
return sub, len(rows)
|
||||
|
||||
|
||||
def add_discovered(store: Store, name: str, domain: str,
|
||||
found: Discovery) -> tuple[str, int]:
|
||||
"""Follow a company from what `app.jobs.discover` found: through
|
||||
`add_board` when the board is readable, else as a row with its `ats` host
|
||||
and careers page, so the company is kept as one the app cannot read yet.
|
||||
Returns the company key and how many roles its board lists (0 with no
|
||||
board). Refuses a company that exists, as `add_board` does."""
|
||||
name = name.strip()
|
||||
if not name:
|
||||
raise ValueError("a company needs a name")
|
||||
key = company_key(name)
|
||||
if found.board:
|
||||
_sub, roles = add_board(store, found.board, name)
|
||||
store.update_company(key, domain=domain, ats=found.ats)
|
||||
return key, roles
|
||||
if store.company(key) is not None:
|
||||
raise ValueError(f"{name} is already followed")
|
||||
store.add_company(name, key=key, domain=domain, ats=found.ats,
|
||||
careers_url=found.careers_url)
|
||||
return key, 0
|
||||
|
||||
|
||||
def search_params(provider: str, q: str, *, area: int = 0, country: str = "",
|
||||
where: str = "", pages: int = 0) -> dict[str, Any]:
|
||||
"""The `params` a search subscription stores, with only the keys its
|
||||
|
||||
Reference in new issue
Block a user