MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / check_iteh

Function check_iteh

scripts/check_standards_versions.py:223–240  ·  view source on GitHub ↗

Check iTeh/CEN page for withdrawn status.

(standard: dict)

Source from the content-addressed store, hash-verified

221
222
223def check_iteh(standard: dict) -> dict | None:
224 """Check iTeh/CEN page for withdrawn status."""
225 status, html = fetch_page(standard["url"])
226 if status == 404:
227 return {"type": "error", "detail": "HTTP 404 - page removed or URL changed"}
228 if status != 200:
229 return {"type": "error", "detail": f"HTTP {status}"}
230
231 # Signal: Status "Withdrawn"
232 if re.search(r"Status\s*Withdrawn", html, re.IGNORECASE):
233 replaced = re.search(r"Replaced by\s*([^<\n]+)", html)
234 return {
235 "type": "withdrawn",
236 "signal": f"Withdrawn. {replaced.group(0) if replaced else ''}".strip(),
237 "new_version": replaced.group(1).strip() if replaced else "",
238 }
239
240 return None
241
242
243CHECKERS = {

Callers

nothing calls this directly

Calls 2

fetch_pageFunction · 0.85
searchMethod · 0.45

Tested by

no test coverage detected