MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / extract_homepage_url

Function extract_homepage_url

agents/master-coordinator/main.py:1174–1184  ·  view source on GitHub ↗

Extract the first plausible personal homepage URL from arbitrary user text.

(text: Any)

Source from the content-addressed store, hash-verified

1172
1173
1174def extract_homepage_url(text: Any) -> Optional[str]:
1175 """Extract the first plausible personal homepage URL from arbitrary user text."""
1176 for match in GENERIC_HTTP_URL_RE.finditer(str(text or "")):
1177 url = str(match.group("url") or "").strip().rstrip(".,);]\u3002\uff0c\uff1b")
1178 if not url:
1179 continue
1180 if "://" not in url:
1181 url = f"https://{url.lstrip('/')}"
1182 if looks_like_homepage_url(url):
1183 return url
1184 return None
1185
1186
1187def strip_bootstrap_urls(text: Any) -> str:

Callers 3

handle_cold_startMethod · 0.85

Calls 1

looks_like_homepage_urlFunction · 0.85

Tested by

no test coverage detected