Decode HTML entities in freehire titles and companies, and separate the region ids in the searches help
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a9c387c130
commit
10dec33dce
3 files changed
+12
-4
No files matched your search
@@ -27,6 +27,7 @@ table of the host's words in `app/prep/hosts/freehire.py`.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import html
|
||||
import json
|
||||
import re
|
||||
from collections.abc import Callable
|
||||
@@ -166,7 +167,7 @@ def _pay(enrichment: dict[str, Any]) -> dict[str, Any]:
|
||||
def rows(decoded: Any, slug: str) -> list[Row]:
|
||||
out: list[Row] = []
|
||||
for hit in decoded.get("data") or []:
|
||||
title = " ".join(str(hit.get("title") or "").split())
|
||||
title = " ".join(html.unescape(str(hit.get("title") or "")).split())
|
||||
source_id = str(hit.get("public_slug") or "").strip()
|
||||
url = _url(str(hit.get("url") or ""))
|
||||
if not title or not source_id or not is_web_url(url):
|
||||
@@ -177,7 +178,7 @@ def rows(decoded: Any, slug: str) -> list[Row]:
|
||||
out.append({
|
||||
"source_id": source_id,
|
||||
"title": title,
|
||||
"company": str(hit.get("company") or "").strip(),
|
||||
"company": html.unescape(str(hit.get("company") or "")).strip(),
|
||||
"url": url,
|
||||
"places": places,
|
||||
"location": places[0]["text"] if places else "",
|
||||
|
||||
Reference in new issue
Block a user