INNER CODE UNIT · Python

fetch_repo_badges

crocs-muni/javacard-curated-list · scripts/process_curated_list.py:206

def fetch_repo_badges(owner, repo):
    urls = badge_urls(owner, repo)
    result = {"stars": None, "last_commit_raw": None, "developers": None, "license": None, "error": None}
    try:
        stars_svg = fetch_with_retries(urls["stars"])
        result["stars"] = parse_stars_svg(stars_svg)
    except (HTTPError, URLError, TimeoutError) as e:
        result["error"] = f"stars:{e}"

    try:
        lc_svg = fetch_with_retries(urls["last_commit"])
        result["last_commit_raw"] = parse_aria_label_value(lc_svg)
    except (HTTPError, URLError, TimeoutError) as e:
        result["error"] = (result["error"] or "") + f" last_commit:{e}"

    try:
        contrib_svg = fetch_with_retries(urls["contributors"])
        val = parse_aria_label_value(contrib_svg)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…