Hosts a to l declare READS: places, teaser, stated seniority and employment
Ashby, BambooHR, Deel, Eightfold, Gem, Greenhouse, HiBob, HR Manager, Jibe, Jobylon and Lever move to feed_url(slug, ask) and page(get, slug, cursor, ask), declare READS with the robots decision, and drop robots_page. Rows carry places (Ashby secondaryLocations, Lever allLocations, Greenhouse offices in place of a Hybrid placeholder), Jobylon keeps its summary as teaser and maps experience and employment, Eightfold reads creationTs as the posting date and Ashby reads workplaceType. Fixtures <name>-places.* and jobylon-teaser.html drive the conformance checks; the eleven names leave UNDECLARED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c0da58da7
commit
f2e652a8da
35 files changed
+1290
-391
No files matched your search
@@ -16,12 +16,35 @@ from __future__ import annotations
|
||||
|
||||
import html
|
||||
import json
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from desk.sources import strip_html
|
||||
|
||||
from ._shared import Get, Page, Row, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount
|
||||
from ._contract import Ask, Fields, Reads, Row
|
||||
from ._shared import Get, Page, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# One ad names one site: a company that hires at two sites posts two ads with
|
||||
# their own ids (Dixa's "Expression of interest" at Copenhagen and London), so
|
||||
# the host publishes one posting per place.
|
||||
READS = Reads(
|
||||
scope="board", listing="paged", text="listing", complete="end",
|
||||
places="copies",
|
||||
fields=Fields(pay="figures", posted="listed", remote="stated", employment="stated"),
|
||||
robots="read: robots.txt allows the careers site; its robots.txt is the single-page "
|
||||
"app's index page with no rules (checked 2026-09-29)",
|
||||
)
|
||||
|
||||
#: `employmentType`, the company's own name for it -> the app's employment
|
||||
#: words. "Permanent" says nothing about hours and stays unmapped.
|
||||
_EMPLOYMENT = {"regular full time": "full_time", "full time": "full_time",
|
||||
"full-time": "full_time", "regular part time": "part_time",
|
||||
"part time": "part_time", "part-time": "part_time", "contract": "contract",
|
||||
"contractor": "contract", "temporary": "temporary", "fixed term": "temporary",
|
||||
"intern": "intern", "internship": "intern", "freelance": "freelance"}
|
||||
|
||||
NAME = "hibob"
|
||||
LABEL = "HiBob"
|
||||
@@ -55,11 +78,7 @@ def careers_url(slug: str) -> str:
|
||||
return f"https://{_host(slug)}/"
|
||||
|
||||
|
||||
def robots_page(slug: str) -> str:
|
||||
return careers_url(slug)
|
||||
|
||||
|
||||
def page(get: Get, slug: str, cursor: Any) -> Page:
|
||||
def page(get: Get, slug: str, cursor: Any, ask: Ask) -> Page:
|
||||
"""The one page: every ad, and no total or cursor, so the board is
|
||||
complete when the answer parses. The host's robots.txt is its single-page
|
||||
app's index page (a 200 with no rules), which allows."""
|
||||
@@ -96,9 +115,12 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]:
|
||||
period = _PERIODS.get(str(ad.get("payTransparencySalaryPayPeriod") or "").strip().lower(), "")
|
||||
salary_min, salary_max, code = yearly_amount(lo, hi, currency, period,
|
||||
{"year": 1, "month": 12})
|
||||
out.append({
|
||||
remote = {"remote": True, "hybrid": False, "on_site": False, "onsite": False}.get(
|
||||
str(ad.get("workspaceTypeId") or "").strip().lower())
|
||||
row: Row = {
|
||||
"source_id": ad_id,
|
||||
"title": title,
|
||||
"places": [{"text": location, "remote": remote}] if location else [],
|
||||
"location": location,
|
||||
"url": f"https://{_host(slug)}/jobs/{ad_id}",
|
||||
"posted": parse_dt(ad.get("publishedAt")),
|
||||
@@ -109,5 +131,12 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]:
|
||||
"salary_min": salary_min,
|
||||
"salary_max": salary_max,
|
||||
"currency": code,
|
||||
})
|
||||
}
|
||||
kind = str(ad.get("employmentType") or "").strip()
|
||||
if kind:
|
||||
if employment := _EMPLOYMENT.get(kind.lower()):
|
||||
row["employment"] = employment
|
||||
else:
|
||||
log.debug("hibob: unknown employmentType %r", kind)
|
||||
out.append(row)
|
||||
return out
|
||||
Reference in new issue
Block a user