(username, api_key)
| 60 | # ------------------------- |
| 61 | |
| 62 | def 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 | |
| 70 | def parse_contributions(data, colors): |
| 71 | weeks = data["data"]["user"]["contributionsCollection"]["contributionCalendar"]["weeks"] |
no outgoing calls
no test coverage detected