MCPcopy Index your code
hub / github.com/fatihak/InkyPi / fetch_contributions

Function fetch_contributions

src/plugins/github/github_contributions.py:62–68  ·  view source on GitHub ↗
(username, api_key)

Source from the content-addressed store, hash-verified

60# -------------------------
61
62def fetch_contributions(username, api_key):
63 url = "https://api.github.com/graphql"
64 headers = {"Authorization": f"Bearer {api_key}"}
65 variables = {"username": username}
66 resp = requests.post(url, json={"query": GRAPHQL_QUERY, "variables": variables}, headers=headers, timeout=30)
67 resp.raise_for_status()
68 return resp.json()
69
70def parse_contributions(data, colors):
71 weeks = data["data"]["user"]["contributionsCollection"]["contributionCalendar"]["weeks"]

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected