MCPcopy Create free account
hub / github.com/HzaCode/OneCite / get_github_stars

Function get_github_stars

scripts/update_stars.py:26–35  ·  view source on GitHub ↗

Fetch star count from GitHub API.

()

Source from the content-addressed store, hash-verified

24
25
26def get_github_stars() -> int:
27 """Fetch star count from GitHub API."""
28 try:
29 response = requests.get(GITHUB_API_URL, timeout=30)
30 response.raise_for_status()
31 data = response.json()
32 return data.get("stargazers_count", 0)
33 except Exception as e:
34 print(f"Error fetching stars: {e}")
35 sys.exit(1)
36
37
38def update_readme_stars_badge(filepath: Path, stars: int) -> bool:

Callers 1

mainFunction · 0.85

Calls 2

raise_for_statusMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected