{"id":28251775,"url":"https://github.com/adam014/commit-sync","last_synced_at":"2025-08-23T09:07:58.282Z","repository":{"id":287687932,"uuid":"965493939","full_name":"Adam014/commit-sync","owner":"Adam014","description":"Synchronizes GitLab and GitHub commit activity into a single contribution heatmap.","archived":false,"fork":false,"pushed_at":"2025-06-27T18:54:09.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T00:08:44.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://commit-sync.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adam014.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T09:38:47.000Z","updated_at":"2025-06-27T18:54:13.000Z","dependencies_parsed_at":"2025-06-12T11:40:37.731Z","dependency_job_id":"4e7ec38f-3ee9-41ca-a1df-bdeb9b78f3ac","html_url":"https://github.com/Adam014/commit-sync","commit_stats":null,"previous_names":["adam014/commitsync","adam014/next-commit-sync","adam014/commit-sync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Adam014/commit-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adam014%2Fcommit-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adam014%2Fcommit-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adam014%2Fcommit-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adam014%2Fcommit-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adam014","download_url":"https://codeload.github.com/Adam014/commit-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adam014%2Fcommit-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746302,"owners_count":24813556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T15:15:31.326Z","updated_at":"2025-08-23T09:07:58.240Z","avatar_url":"https://github.com/Adam014.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commit-sync\n\n# Overview\n\nThe Heatmap API generates a self‑contained SVG representing your activity for the current month, combining: - GitHub commits (via the Search API) - GitLab events - A GitHub‑style calendar grid - A month/year header, total‑event count, and a “Less … More” legend\n\nAll you need is to call:\n\n```http\nGET /api/heatmap?github=\u003cGH_USERNAME\u003e\u0026gitlab=\u003cGL_USERNAME\u003e\u0026mode=\u003clight|dark\u003e\u0026bg=%\u003cHEX_COLOR\u003e\n```\n\nTo get SVG image of your git heatmap.\n\n## Endpoint\n\n```http\nGET /api/heatmap\nHost: your-domain.com\n```\n\nResponse:\n\n- 200 OK\n- `Content-Type: image/svg+xml`\n- No caching (headers: `Cache-Control: no-cache, no store, must-revalidate)¨\n\n## Query Parameters\n\n| Parameter | Type   | ?Required | Default        | Description       |\n| --------- | ------ | --------- | -------------- | ----------------- |\n| github    | string | No        | \"\"             | Github username   |\n| gitlab    | string | No        | \"\"             | Gitlab username   |\n| mode      | string | No        | \"light\"        | \"light\" or \"dark\" |\n| bg        | hex    | No        | Light: #f4f8d3 |\n|           |        |           | Dark: #0a0a0a  |\n\nAt least one of `github` or `gitlab` must be non-empty for any activity to appear. Empty names simply skip the corresponding service.\n\n## How it works\n\n1. Date range\n   - Automatically set to the first day of this month throught today\n2. Github Commits\n   - Uses the Search Commits API:\n   ```http\n       GET https://api.github.com/search/commits\n       ?q=author:\u003cgithubUsername\u003e committer-date:\u003cstart\u003e..\u003cend\u003e\n       \u0026per_page=100\n       Accept: application/vnd.github.cloak-preview\n       Authorization: token YOUR_GITHUB_API_KEY\n   ```\n   - Counts each returned commit\n3. Gitlab Events\n   - Fetches the user by name, then their `/events?per_page=100` feed\n   - Counts each event occurrence\n4. Aggregation\n   - Creates a day-keyed map (`YYYY-MM-DD`) initialized to zero for every day of the month.\n   - Increments the count for each commit/event\n5. SVG Rendering\n   - Header: `April 2025 37 events`\n   - Legend: Less [□][□][□][□][□] More\n   - Grid: Weeks \\* 7, each cell sized 30x30 pixels (with 2 pixels gaps), colored via `getColor(count, darkMode)` and labeled with the day number.\n\n## Usage examples\n\n### Light mode (default bg)\n\n```html\n\u003cimg src=\"/api/heatmap?github=octocat\u0026gitlab=octocat\" alt=\"My April Activity\" /\u003e\n```\n\n### Dark mode with custom background\n\n```html\n\u003cimg\n  src=\"/api/heatmap?\n     github=octocat\n     \u0026gitlab=octocat\n     \u0026mode=dark\n     \u0026bg=%23111111\"  \u003c!-- note: URL‑encode “#” as “%23” --\u003e\n  alt=\"My April Activity (dark)\"\n/\u003e\n```\n\n### Only GitHub\n\n```html\n\u003cimg src=\"/api/heatmap?github=octocat\" alt=\"GitHub only heatmap\" /\u003e\n```\n\n###### Thanks if you read this far, I really appreciate it. It means a lot to me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam014%2Fcommit-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadam014%2Fcommit-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam014%2Fcommit-sync/lists"}