MCPcopy
hub / github.com/zer0yu/CyberSecurityRSS / _extract_atom_html_url

Function _extract_atom_html_url

scripts/add_feed_to_tiny.py:138–151  ·  view source on GitHub ↗
(root: ET.Element)

Source from the content-addressed store, hash-verified

136
137
138def _extract_atom_html_url(root: ET.Element) -> str:
139 fallback = ""
140 for child in list(root):
141 if strip_namespace(child.tag) != "link":
142 continue
143 href = normalize_url(child.attrib.get("href", ""))
144 if not href:
145 continue
146 rel = (child.attrib.get("rel", "alternate") or "alternate").strip().lower()
147 if rel in {"alternate", ""}:
148 return href
149 if not fallback:
150 fallback = href
151 return fallback
152
153
154def _build_feed_metadata(root_name: str, title: str, html_url: str, feed_url: str) -> FeedMetadata:

Callers 1

parse_feed_metadataFunction · 0.85

Calls 2

strip_namespaceFunction · 0.70
normalize_urlFunction · 0.70

Tested by

no test coverage detected