diff --git a/plugins/readers/smartrecruiters.py b/plugins/readers/smartrecruiters.py index 77e7683..86b9079 100644 --- a/plugins/readers/smartrecruiters.py +++ b/plugins/readers/smartrecruiters.py @@ -13,16 +13,26 @@ A fetch term goes as `?q=engineer`, one a request (`Filters(query="one")`): it matches title and text, and with `country=` it is an AND (survey, 2026-09-30: `q=engineer` answered 1,713 of Bosch's 4,830, with `country=dk` none). How several words in one `q` combine is untested. + +The list has no text. The text is read per posting by `detail`, `GET +/v1/companies/{slug}/postings/{id}` (checked 2026-09-30, Delivery Hero's +744000151349134): `jobAd.sections` holds `companyDescription`, +`jobDescription`, `qualifications` and `additionalInformation`, each with a +`title` and its `text` as HTML. The description joins the last three; the +company blurb is the same on every role of the board and is left out. """ from __future__ import annotations +import html import json import re from collections.abc import Callable from typing import Any from urllib.parse import quote +from desk.sources import strip_html + from ._contract import Ask, Fields, Filters, Place, Reads from ._shared import Get, Page, Row, only, parse_dt, path_slug_ok @@ -35,7 +45,7 @@ PATTERNS = ( #: An unknown identifier answers an empty list, which is `empty="suspect"`. READS = Reads( - scope="board", listing="paged", page_size=100, text="none", complete="stated", + scope="board", listing="paged", page_size=100, text="detail", complete="stated", places="one", empty="suspect", filters=Filters(country="one", query="one"), fields=Fields(posted="trusted", remote="stated", country="stated", seniority="stated", employment="stated"), @@ -96,9 +106,9 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: """One page of https://api.smartrecruiters.com/v1/companies/{slug}/postings -> `{"offset", "limit", "totalFound", "content": [...]}`. At most 100 a page, whatever `limit` asks for; the next is `?offset=` further on. The - list omits the job description (only the per-posting detail endpoint has - it, and fetching one per row would be hundreds of extra requests per - board), so `description` stays empty here. A posting has one location, + list omits the job description (only the per-posting endpoint has it, + which `detail` reads for the roles worth it), so `description` stays + empty here. A posting has one location, its `country` a lower-case ISO code, `experienceLevel` and `typeOfEmployment` (an `id` and a `label` each).""" out = [] @@ -130,3 +140,28 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: "employment": _word(j, "typeOfEmployment"), }) return out + + +#: The sections of a posting's ad that make its description, in reading order. +#: `companyDescription` is the employer's blurb, alike on every role. +_SECTIONS = ("jobDescription", "qualifications", "additionalInformation") + + +def detail(get: Get, slug: str, row: Row) -> dict[str, Any]: + """`/v1/companies/{slug}/postings/{id}` -> `jobAd.sections`: the HTML of + `jobDescription`, `qualifications` and `additionalInformation`, one + text. An answer without `jobAd.sections` is + not a posting and raises, so the role is asked again on a later pull.""" + posting = quote(str(row["source_id"]), safe="") + data = json.loads(get(f"https://{_API}/v1/companies/{slug}/postings/{posting}")) + sections = ((data.get("jobAd") or {}).get("sections") + if isinstance(data, dict) else None) + if not isinstance(sections, dict): + raise ValueError("not a SmartRecruiters posting: no jobAd.sections") + parts = [] + for key in _SECTIONS: + text = " ".join(html.unescape(strip_html(str((sections.get(key) or {}).get("text") or ""))) + .split()) + if text: + parts.append(text) + return {"description": " ".join(parts)} diff --git a/plugins/readers/workable.py b/plugins/readers/workable.py index 4ed795c..8b0a968 100644 --- a/plugins/readers/workable.py +++ b/plugins/readers/workable.py @@ -3,14 +3,25 @@ total. Written from one real board, Hugging Face's, on 2026-09-28, when the first board with roles was seen; jobhunt-hq did not read Workable. + +The list carries no text. The text is read per role by `detail`, `GET +/api/v2/accounts/{slug}/jobs/{shortcode}` (checked 2026-09-30, Hugging Face's +DB4D7C0EC8): the list's fields again, and `description`, `requirements` and +`benefits` as HTML. The list gives the numeric `id` and the `shortcode`; the +role's `source_id` is the number, so the row keeps the `shortcode` for this +request. The API answers 429 to a run of requests; the runner spaces the +reads and stops on one. """ from __future__ import annotations +import html import json 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 Get, Page, Row, add_place, only, parse_dt, path_slug_ok @@ -23,7 +34,7 @@ PATTERNS = ( ) READS = Reads( - scope="board", listing="paged", page_size=10, text="none", complete="stated", + scope="board", listing="paged", page_size=10, text="detail", complete="stated", places="many", fields=Fields(posted="trusted", remote="stated", employment="stated"), robots="api: no robots.txt check needed (public board API), 2026-09-30", @@ -82,8 +93,8 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: -> `{"total": int, "results": [...], "nextPage": token}`, as Hugging Face's board answered on 2026-09-28. A result carries no URL and no text: the job page is `https://apply.workable.com/{slug}/j/{shortcode}/`, and - the description is only on the per-job endpoint, one request per role, - so `description` stays empty here as it does for SmartRecruiters. + the description is only on the per-job endpoint, which `detail` reads, so + `description` stays empty here. The `shortcode` is kept in the row for it. `location` is the first place and `locations` all of them; `department` is a list; `remote` is a flag beside `workplace` (remote, hybrid, on_site); `type` is the hours or the contract (full, part, ...).""" @@ -101,6 +112,7 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: dept = ", ".join(d for d in dept if d) out.append({ "source_id": str(j.get("id") or shortcode), + "shortcode": shortcode, "title": title, "places": places, "location": "; ".join(p["text"] for p in places), @@ -113,3 +125,26 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: "employment": str(j.get("type") or "").strip() or None, }) return out + + +#: The parts of a role's ad that make its description, in reading order. +_PARTS = ("description", "requirements", "benefits") + + +def detail(get: Get, slug: str, row: Row) -> dict[str, Any]: + """`/api/v2/accounts/{slug}/jobs/{shortcode}` -> the HTML of + `description`, `requirements` and `benefits`, joined as one text. An + answer with none of the three keys is not a role and raises, so the role + is asked again on a later pull.""" + shortcode = str(row.get("shortcode") or "") + if not path_slug_ok(shortcode): + raise ValueError(f"no Workable shortcode in the row: {shortcode!r}") + data = json.loads(get(f"https://{_API}/api/v2/accounts/{slug}/jobs/{shortcode}")) + if not isinstance(data, dict) or not any(k in data for k in _PARTS): + raise ValueError("not a Workable role: no description") + parts = [] + for key in _PARTS: + text = " ".join(html.unescape(strip_html(str(data.get(key) or ""))).split()) + if text: + parts.append(text) + return {"description": " ".join(parts)} diff --git a/tests/fixtures/ats/smartrecruiters-detail.json b/tests/fixtures/ats/smartrecruiters-detail.json new file mode 100644 index 0000000..4145278 --- /dev/null +++ b/tests/fixtures/ats/smartrecruiters-detail.json @@ -0,0 +1 @@ +{"id":"744000151349134","name":"Legal Counsel, EU Employment Law (Platform Workers)","uuid":"655a2a58-fd88-4265-9515-ed20950644d9","jobId":"4a203380-42d7-423b-a1cf-adfedae74ae5","jobAdId":"3546365e-c8d6-43b8-b753-73c4f9e13ef8","defaultJobAd":false,"refNumber":"JR0081588","company":{"name":"Delivery Hero","identifier":"DeliveryHero"},"location":{"city":"Stockholm","region":"Stockholm County","country":"se","remote":false,"hybrid":false,"latitude":"59.3327036","longitude":"18.0656255","fullLocation":"Stockholm, Stockholm County, Sweden"},"customField":[{"fieldId":"6564ad3fee5f2f5b84045448","fieldLabel":"Job Family Group","valueId":"74446f87526f01023ba05b2344241d1b","valueLabel":"Legal"},{"fieldId":"6564ae9ddd552072c3a97453","fieldLabel":"Time Type","valueId":"421938a4e1d40118e396324490147300","valueLabel":"Full time"},{"fieldId":"6564aa853d74d30a33089d2a","fieldLabel":"Supervisory Organization","valueId":"81e6b64e3ee2011754bb2c1f5b01c5d8","valueLabel":"Legal Commercial Regulatory - Logistics DHSE - HIE03090"},{"fieldId":"COUNTRY","fieldLabel":"Country/Region","valueId":"hu","valueLabel":"Hungary"},{"fieldId":"6564ad09560ccd2ba9e90d24","fieldLabel":"Management Level","valueId":"ef2e8d3982de0147be16f744d2163300","valueLabel":"IC4"},{"fieldId":"6564ae71dd552072c3a97452","fieldLabel":"Worker Sub-Type","valueId":"ef2e8d3982de0123e1696445d2164400","valueLabel":"Permanent"},{"fieldId":"655ce69d695b8c5663cf1f55","fieldLabel":"Brands","valueId":"Foodora","valueLabel":"foodora"},{"fieldId":"6564ad6b1cf48c421e22419d","fieldLabel":"Job Family","valueId":"7d466ad1cc7701d28bd20926b000a75e","valueLabel":"Commercial Law"},{"fieldId":"6564abc0d641ff6fc90ebd6d","fieldLabel":"Primary Location","valueId":"dd8bd6e8ef5e01f0b31a22394e012004","valueLabel":"Berlin - Oranienburger Straße"},{"fieldId":"6564ada8e5ee8c3d9bec3405","fieldLabel":"Job Profile","valueId":"a2e7316c822c10009473b15208810000","valueLabel":"Commercial Law - IC4"}],"releasedDate":"2026-09-23T11:04:44.986Z","creator":{"name":"","avatarUrl":""},"postingUrl":"https://jobs.smartrecruiters.com/DeliveryHero/744000151349134-legal-counsel-eu-employment-law-platform-workers-","applyUrl":"https://jobs.smartrecruiters.com/DeliveryHero/744000151349134-legal-counsel-eu-employment-law-platform-workers-?oga=true","referralUrl":"https://jobs.smartrecruiters.com/external-referrals/company/DeliveryHero/publication/655a2a58-fd88-4265-9515-ed20950644d9?dcr_ci=DeliveryHero","jobAd":{"sections":{"companyDescription":{"title":"Company Description","text":"
foodora is part of the Delivery Hero Group, the world’s pioneering local delivery platform, our mission is to deliver an amazing experience—fast, easy, and to your door. We operate in over 65+ countries worldwide. Headquartered in Berlin, Germany. Delivery Hero has been listed on the Frankfurt Stock Exchange since 2017 and is part of the MDAX stock market index.
"},"jobDescription":{"title":"Job Description","text":"We are on the lookout for a Legal Counsel, EU Employment Law to join the Legal Team on our journey to always deliver amazing experiences.
Join the team that protects and enables Delivery Hero’s growth. In the Legal Team, you’ll support key initiatives by providing proactive legal guidance that aligns business goals with regulatory standards. Your work will help mitigate risks and ensure we’re positioned for sustainable, long-term success—making you a key contributor to our mission of delivering amazing experiences worldwide.
As a Legal Counsel, you will advise Delivery Hero on employment law challenges related to platform work across the world. Our ideal candidate is a seasoned employment lawyer with litigation experience, passionate about the gig economy, and excited to help shape the future of work.
About the opportunity
Lead the management of platform worker and rider classification risks globally, working closely with international employment lawyers across the Group.
Monitor and manage high-profile litigation and regulatory investigations, and develop defense strategies in collaboration with local legal counsel.
Partner with Product, Tech, and Operations teams to deeply understand delivery operations and the tech stack, and support the development of next-generation delivery solutions.
Support cross-functional teams in exploring new business models and strategic opportunities related to platform work.
Track and analyze legislative and regulatory developments impacting platform work, and advise Public Policy teams at HQ and market level.
Act as a subject-matter expert, providing guidance to senior management and stakeholders across the Group, including availability for limited international travel (up to 10%).
Fully qualified employment lawyer in an EU jurisdiction, with extensive experience in employment law, including at least 3 years in a law firm environment and a strong background in litigation; prior in-house experience is a plus.
Deep expertise in platform work and worker classification, with hands-on experience interpreting and applying the EU Platform Workers Directive and related employment legislation.
Strong legal judgment with the ability to influence, demonstrated through advising senior stakeholders and collaborating effectively across multi-jurisdictional and cross-functional teams.
Excellent communication and drafting skills, including experience in legal drafting, executive-level communication, and creating clear, compelling slide presentations.
Collaborative and impact-driven mindset, with hands-on experience thriving in fast-paced, evolving environments and contributing beyond defined role boundaries when needed.
Full professional proficiency in English (working language) and fluency in at least one additional European language, with willingness to be based in or relocate to one of our markets in the EU.
We believe diversity and inclusion are key to creating not only an exciting product, but also an amazing customer and employee experience. Fostering this starts with hiring - therefore we do not discriminate on the basis of racial identities, religious beliefs, color, national origin, gender identities or expressions, sexual orientations, age, marital or disability statuses, or any other aspect that makes you, you.
\n
\nWe encourage you to let us know if you need any accommodations or specific accessibility support to ensure a smooth interview experience—just let us know with an email to our Inclusion Officer at inclusion@deliveryhero.com.
\n
\nSeverely disabled applicants with equal qualifications will be given preferential consideration.
\n
\nYou're welcome to share your pronouns (he/she/they) right from the start so we can address you respectfully from our first contact.
At Hugging Face, we're on a journey to democratize good AI. We are building the fastest growing platform for AI builders with over 11 million users who collectively shared over 4 million models, 1 million datasets & 1.5 million Gradio apps. Our open-source libraries have more than 700,000 stars on Github.
About the Role
Roles at Hugging Face are very fluid and dynamic — we are looking for someone who is comfortable taking on different challenges that will evolve over time.
You'll join the Applications team, whose goal is to build the tooling that helps developers create machine learning applications on top of the primitives we offer on the Hub: Gradio, Spaces, Inference Providers, Datasets, Xet, and more. Concretely, that means maintaining and growing libraries like Trackio, a local-first, agent-friendly experiment tracking platform, FastRTC, our library for real-time audio and video streaming in Python, and Gradio itself, used by more than 1 million developers each month. These tools have made machine learning accessible to a wide audience — for the first time in history, anyone with an internet connection can use cutting-edge models right from their browser.
Several of these libraries are still early in their life, and new ones will start from scratch. A large part of this role is taking a project from its first users to widespread adoption: shaping the API, shipping fast, and getting it into developers' hands.
Key responsibilities include:
If you love open-source, are passionate about making machine learning more accessible, have experience building Python frameworks, and want to contribute to some of the fastest-growing libraries in the ML ecosystem, then we can't wait to see your application!
What you'll need
Nice to have
If you're interested in joining us, but don't tick every box above, we still encourage you to apply! We're building a diverse team whose skills, experiences, and backgrounds complement one another. We're happy to consider where you might be able to make the biggest impact.
One more thing
At Hugging Face we believe great AI shouldn't require a massive cluster, we build for everyone, especially the GPU-poor. And because we read every application, here's a small sign that you read this one too: start your answer to the first application question with the words “GPU-poor and proud 🤗”. No trick, no catch, it just tells us a real person is on the other side.
","benefits":"More about Hugging Face
We are actively working to build a culture that values diversity, equity, and inclusivity. We are intentionally building a workplace where people feel respected and supported—regardless of who you are or where you come from. We believe this is foundational to building a great company and community. Hugging Face is an equal opportunity employer and we do not discriminate on the basis of race, religion, color, national origin, gender, sexual orientation, age, marital status, veteran status, or disability status.
We value development. You will work with some of the smartest people in our industry. We are an organization that has a bias for impact and is always challenging ourselves to continuously grow. We provide all employees with reimbursement for relevant conferences, training, and education.
We care about your well-being. We offer flexible working hours and remote options. We offer health, dental, and vision benefits for employees and their dependents. We also offer parental leave and flexible paid time off.
We support our employees wherever they are. While we have office spaces in NYC and Paris, we're very distributed and all remote employees have the opportunity to visit our offices. If needed, we'll also outfit your workstation to ensure you succeed.
We want our teammates to be shareholders. All employees have company equity as part of their compensation package. If we succeed in becoming a category-defining platform in machine learning and artificial intelligence, everyone enjoys the upside.
We support the community. We believe major scientific advancements are the result of collaboration across the field. Join a community supporting the ML/AI community.
"} \ No newline at end of file diff --git a/tests/test_ats_smartrecruiters.py b/tests/test_ats_smartrecruiters.py index e2db36e..c291f72 100644 --- a/tests/test_ats_smartrecruiters.py +++ b/tests/test_ats_smartrecruiters.py @@ -7,12 +7,15 @@ import json import sys from pathlib import Path +import pytest + ROOT = Path(__file__).resolve().parents[1] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) -from plugins.readers import Ask, smartrecruiters # noqa: E402 +from desk.sources import strip_html # noqa: E402 +from plugins.readers import Ask, _runner, smartrecruiters # noqa: E402 FIXTURES = ROOT / "tests" / "fixtures" / "ats" @@ -30,7 +33,7 @@ def _rows(*postings: dict) -> list[dict]: def test_the_declaration_says_what_the_list_gives() -> None: reads = smartrecruiters.READS assert (reads.listing, reads.page_size, reads.places, reads.text, reads.empty) == \ - ("paged", 100, "one", "none", "suspect") + ("paged", 100, "one", "detail", "suspect") assert reads.fields.posted == "trusted" and reads.fields.seniority == "stated" assert reads.robots.startswith("api: no robots.txt check needed") @@ -72,3 +75,45 @@ def test_the_saved_page_still_reads() -> None: data = json.loads((FIXTURES / "smartrecruiters.json").read_bytes()) assert [r["location"] for r in smartrecruiters.rows(data, "Acme")] == ["Berlin, Germany", "Remote"] + + +def test_detail_reads_the_ad_without_the_company_blurb() -> None: + asked: list[str] = [] + + def get(url: str, **_: object) -> bytes: + asked.append(url) + return (FIXTURES / "smartrecruiters-detail.json").read_bytes() + + found = smartrecruiters.detail(get, "deliveryhero", {"source_id": "744000151349134"}) + assert asked == ["https://api.smartrecruiters.com/v1/companies/deliveryhero/postings/" + "744000151349134"] + assert set(found) == {"description"} and set(found) <= set(_runner.DETAIL_FIELDS) + text = found["description"] + data = json.loads((FIXTURES / "smartrecruiters-detail.json").read_bytes()) + sections = data["jobAd"]["sections"] + assert data["jobAd"]["sections"]["companyDescription"]["text"] + assert strip_html(sections["companyDescription"]["text"])[:60] not in text + assert strip_html(sections["jobDescription"]["text"])[:60] in text + assert strip_html(sections["qualifications"]["text"])[-40:] in text + assert strip_html(sections["additionalInformation"]["text"])[-40:] in text + assert "<" not in text and " " not in text and len(text) > 1500 + + +def test_detail_leaves_out_a_section_the_ad_lacks() -> None: + body = json.dumps({"jobAd": {"sections": { + "jobDescription": {"text": "Build & run
Build & run
", "requirements": None, + "benefits": "