Delete the _UNREADABLE entries of hosts that have a module
Ten entries were shadowed by their modules. A test now holds that no entry names a reader, which replaces the per-host checks. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f1b9e93e1
commit
531c8bc337
7 files changed
+11
-18
No files matched your search
+4
-13
@@ -10,7 +10,8 @@ parses) becomes a `board` target the pull can read; any other host is
|
||||
recorded as `ats`, with its slug where the URL carries one, so the company is
|
||||
kept as one the app cannot read yet rather than dropped. The patterns and
|
||||
probes of a readable host are its module's; the hosts only named are in
|
||||
`_UNREADABLE` here, and one of them that gains a module is read from then on.
|
||||
`_UNREADABLE` here, and a host that gains a module loses its entry there
|
||||
(`tests/test_discover.py` holds that no entry names a reader).
|
||||
|
||||
A Teamtailor site on the company's own domain names no slug: the page only
|
||||
loads Teamtailor's CDN. The board there is the site's own host, and it is
|
||||
@@ -65,27 +66,17 @@ READABLE: tuple[str, ...] = tuple(readers.HOSTS)
|
||||
#: company by, kept for the day a parser exists; a host with no group is
|
||||
#: recognised but its board has no slug the app could use.
|
||||
_UNREADABLE: tuple[tuple[str, str], ...] = (
|
||||
("workday", r"https?://([a-z0-9-]+)\.wd\d+\.myworkdayjobs\.com"),
|
||||
("successfactors", r"(?:career|jobs|performancemanager)\d*\.successfactors\.(?:eu|com)|\.sapsf\.(?:eu|com)"),
|
||||
("icims", r"https?://([a-z0-9-]+)\.icims\.com"),
|
||||
("taleo", r"\.taleo\.net"),
|
||||
("jobvite", r"jobs\.jobvite\.com/([a-z0-9-]+)"),
|
||||
("bamboohr", r"https?://([a-z0-9-]+)\.bamboohr\.com"),
|
||||
("join", r"join\.com/companies/([a-z0-9-]+)"),
|
||||
("softgarden", r"https?://([a-z0-9-]+)\.softgarden\.io"),
|
||||
("pinpoint", r"https?://([a-z0-9-]+)\.pinpointhq\.com"),
|
||||
("rippling", r"ats\.rippling\.com/([a-z0-9-]+)"),
|
||||
("gem", r"jobs\.gem\.com/([a-z0-9-]+)"),
|
||||
("breezy", r"https?://([a-z0-9-]+)\.breezy\.hr"),
|
||||
("homerun", r"https?://([a-z0-9-]+)\.homerun\.co"),
|
||||
("jazzhr", r"https?://([a-z0-9-]+)\.applytojob\.com"),
|
||||
("welcometothejungle", r"welcometothejungle\.com/[a-z]{2}/companies/([a-z0-9-]+)"),
|
||||
("eightfold", r"\.eightfold\.ai"),
|
||||
("phenom", r"phenompeople\.com|phenom\.com/careers"),
|
||||
("avature", r"\.avature\.net"),
|
||||
("oracle", r"oraclecloud\.com/hcmUI"),
|
||||
("comeet", r"comeet\.com/jobs/([a-z0-9-]+)"),
|
||||
("hibob", r"https?://([a-z0-9-]+)\.hibob\.com"),
|
||||
)
|
||||
|
||||
|
||||
@@ -94,8 +85,8 @@ def _hosts(modules: Mapping[str, ModuleType],
|
||||
"""Every host's patterns, compiled: the readable hosts' from their
|
||||
modules first, so the first match at one place on a page is the one the
|
||||
app can read, then the unreadable ones. An unreadable host that has
|
||||
gained a module is left out here, since its module's patterns replace
|
||||
it."""
|
||||
a module is left out, so its module's patterns win even before its
|
||||
entry is deleted."""
|
||||
out = [(name, pattern) for name, module in modules.items() for pattern in module.PATTERNS]
|
||||
out += [(host, pattern) for host, pattern in unreadable if host not in modules]
|
||||
return tuple((host, re.compile(pattern, re.IGNORECASE)) for host, pattern in out)
|
||||
|
||||
Reference in new issue
Block a user