INNER CODE UNIT · Python
load_config
jpush/jpush-react-native · .claude/skills/update-sdk/scripts/changelog_fetcher.py:19
def load_config():
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
return json.load(f)
def fetch_changelog(url: str, target_version: str) -> str:
"""Fetch and extract changelog section for target_version from a Markdown URL."""
md_url = url if url.endswith(".md") else url + ".md"
try:
resp = requests.get(md_url, headers=HEADERS, timeout=30)
resp.raise_for_status()
content = resp.text
except requests.RequestException as e:
return f"ERROR: Failed to fetch {md_url}: {e}"
lines = content.split("\n")
in_section = False