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

Function _parse_scholar_stats

agents/coldstart-agent/main.py:643–656  ·  view source on GitHub ↗

Extract profile-level citation stats when the sidebar table is available.

(html_text: str)

Source from the content-addressed store, hash-verified

641 if not value:
642 return ""
643 without_scripts = re.sub(r"(?is)<(script|style)[^>]*>.*?</\1>", " ", value)
644 plain = re.sub(r"(?s)<[^>]+>", " ", without_scripts)
645 return _collapse_whitespace(html.unescape(plain))
646
647
648def _extract_first_group(pattern: str, text: str) -> str:
649 """Return the first non-empty capture group for a regex search."""
650 match = re.search(pattern, text or "", re.IGNORECASE | re.DOTALL)
651 if not match:
652 return ""
653 for group in match.groups():
654 if group:
655 return group
656 return match.group(0)
657
658
659def _build_scholar_profile_url(

Callers 1

Calls 1

_strip_htmlFunction · 0.70

Tested by

no test coverage detected