Declare READS for Oracle, Personio, Phenom, Pinpoint, Recruitee, Rippling, SmartRecruiters, SuccessFactors, Teamtailor, Workable and Workday
Every row carries places (Personio additionalOffices, Workable and Recruitee locations[], every SuccessFactors address, Workday's own read), the list teaser of Phenom and Oracle is kept in teaser, and the level, employment and country a host states are mapped. Workday "N Locations" and "Country - City", and Recruitee "Remote job", are no longer places. Phenom takes dateCreated as posted. robots_page and ROBOTS_ANY_CASE go; READS.robots records the decision. Signatures are feed_url(slug, ask) and page(get, slug, cursor, ask), with an empty Ask as the default so the runner of today still calls them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c0da58da7
commit
4316624769
42 files changed
+3126
-199
No files matched your search
@@ -8,18 +8,45 @@ Recruitee.
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from desk.sources import strip_html
|
||||
|
||||
from ._contract import Ask, Fields, Place, Reads
|
||||
from ._shared import Row, is_web_url, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
NAME = "recruitee"
|
||||
LABEL = "Recruitee"
|
||||
RANK = 60
|
||||
PATTERNS = (r"https?://([a-z0-9-]+)\.recruitee\.com",)
|
||||
|
||||
READS = Reads(
|
||||
scope="board", listing="whole", text="listing", complete="whole",
|
||||
places="many",
|
||||
fields=Fields(pay="figures", posted="trusted", remote="stated", country="stated",
|
||||
seniority="stated", employment="stated"),
|
||||
robots="api: no robots.txt check needed (public board API), 2026-09-30",
|
||||
)
|
||||
|
||||
#: `experience_code` -> the app's levels. `experienced` names no level and is
|
||||
#: known, so it maps to none; a word not listed is logged at debug level.
|
||||
_SENIORITY = {"student_school": "intern", "entry_level": "junior", "mid_level": "mid",
|
||||
"experienced": ""}
|
||||
|
||||
#: The words of `employment_type_code` (`fulltime_permanent`), the first that
|
||||
#: is found deciding, so a contract type beats the hours.
|
||||
_EMPLOYMENT = (("internship", "internship"), ("intern", "internship"),
|
||||
("freelance", "contract"), ("contract", "contract"),
|
||||
("temporary", "temporary"), ("fixed", "temporary"),
|
||||
("parttime", "part_time"), ("fulltime", "full_time"))
|
||||
|
||||
#: What the board writes as a place for a role that is worked anywhere.
|
||||
_NO_PLACE = ("remote job",)
|
||||
|
||||
|
||||
def slug_ok(slug: str) -> bool:
|
||||
return label_slug_ok(slug)
|
||||
@@ -35,7 +62,7 @@ def careers_url(slug: str) -> str:
|
||||
return f"https://{slug}.recruitee.com"
|
||||
|
||||
|
||||
def feed_url(slug: str) -> str:
|
||||
def feed_url(slug: str, ask: Ask = Ask()) -> str:
|
||||
return f"https://{slug}.recruitee.com/api/offers/"
|
||||
|
||||
|
||||
@@ -55,7 +82,63 @@ def _salary_text(salary: dict[str, Any]) -> str:
|
||||
salary.get("currency"), period)
|
||||
|
||||
|
||||
def _seniority(code: str) -> str | None:
|
||||
key = code.strip().lower()
|
||||
if key not in _SENIORITY:
|
||||
if key:
|
||||
log.debug("recruitee: unknown experience_code %r", code)
|
||||
return None
|
||||
return _SENIORITY[key] or None
|
||||
|
||||
|
||||
def _employment(code: str) -> str | None:
|
||||
words = set(code.strip().lower().replace("-", "_").split("_"))
|
||||
for word, value in _EMPLOYMENT:
|
||||
if word in words:
|
||||
return value
|
||||
if code.strip():
|
||||
log.debug("recruitee: unknown employment_type_code %r", code)
|
||||
return None
|
||||
|
||||
|
||||
def _places(offer: dict[str, Any]) -> tuple[list[Place], set[str]]:
|
||||
"""Every place of an offer and the countries' codes among them. `locations`
|
||||
lists them (city, state, country), `location` is the first as one line and
|
||||
is the fallback for an offer that lists none. The board writes "Remote
|
||||
job" where an offer has no place: that is not one, and a remote offer with
|
||||
no other place has the place "Remote"."""
|
||||
found: list[Place] = []
|
||||
codes: set[str] = set()
|
||||
|
||||
def add(text: str) -> None:
|
||||
text = text.strip()
|
||||
if text and text.lower() not in _NO_PLACE and text not in (p["text"] for p in found):
|
||||
found.append({"text": text, "remote": None})
|
||||
|
||||
for loc in offer.get("locations") or []:
|
||||
if not isinstance(loc, dict):
|
||||
continue
|
||||
parts: list[str] = []
|
||||
for part in (loc.get("city") or loc.get("name"), loc.get("state"), loc.get("country")):
|
||||
part = str(part or "").strip()
|
||||
if part and part not in parts:
|
||||
parts.append(part)
|
||||
add(", ".join(parts))
|
||||
if code := str(loc.get("country_code") or "").strip().upper():
|
||||
codes.add(code)
|
||||
if not found:
|
||||
add(str(offer.get("location") or offer.get("city") or ""))
|
||||
if code := str(offer.get("country_code") or "").strip().upper():
|
||||
codes.add(code)
|
||||
if not found and offer.get("remote"):
|
||||
found.append({"text": "Remote", "remote": True})
|
||||
return found, codes
|
||||
|
||||
|
||||
def parse(body: bytes, slug: str) -> list[Row]:
|
||||
"""`{slug}.recruitee.com/api/offers/` -> `{"offers": [...]}`. An offer has
|
||||
`locations` (a list; 9 of 16 at bunq have two or three), `remote`,
|
||||
`experience_code` and `employment_type_code`, and the salary object."""
|
||||
data = json.loads(body)
|
||||
rows = []
|
||||
for j in data.get("offers") or []:
|
||||
@@ -67,10 +150,12 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
salary_min, salary_max, currency = yearly_amount(
|
||||
salary.get("min"), salary.get("max"), salary.get("currency"),
|
||||
salary.get("period"), {"year": 1, "month": 12})
|
||||
places, codes = _places(j)
|
||||
rows.append({
|
||||
"source_id": str(j.get("id") or ""),
|
||||
"title": title,
|
||||
"location": (j.get("location") or j.get("city") or "").strip(),
|
||||
"places": places,
|
||||
"location": "; ".join(p["text"] for p in places),
|
||||
"url": url,
|
||||
"posted": parse_dt(j.get("published_at") or j.get("created_at")),
|
||||
"department": (j.get("department") or "").strip(),
|
||||
@@ -80,5 +165,8 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
"salary_min": salary_min,
|
||||
"salary_max": salary_max,
|
||||
"currency": currency,
|
||||
"country": next(iter(codes)) if len(codes) == 1 else None,
|
||||
"seniority": _seniority(str(j.get("experience_code") or "")),
|
||||
"employment": _employment(str(j.get("employment_type_code") or "")),
|
||||
})
|
||||
return rows
|
||||
Reference in new issue
Block a user