Skip to content

feat(wakatime): add coding time badges for user, project and repo [WakaTime] - #12232

Open
setchy wants to merge 2 commits into
badges:masterfrom
setchy:feat/wakatime-badges
Open

setchy wants to merge 2 commits into
badges:masterfrom
setchy:feat/wakatime-badges

Conversation

@setchy

@setchy setchy commented Oct 12, 2026 •

Copy link
Copy Markdown

Resumes the work from #11790 (closed due to inactivity), originally proposed by @ashif323, and closes #11722.

What changed

The original PR exposed /wakatime/user/:id and /wakatime/project/:id. The latter no longer resolves upstream (https://wakatime.com/badge/project/{uuid}.svg returns 404). This version targets the endpoints WakaTime actually serves:

Badge Route Where the id comes from
User coding time /wakatime/user/{user} the badge snippet on your WakaTime profile (the id is a UUID, not your username)
Project coding time /wakatime/user/{user}/project/{project} "Project Badges" at https://wakatime.com/share
Repo coding time /wakatime/github/{owner}/{repo} "Repo Badges" at https://wakatime.com/share

The services extend BaseSvgScrapingService (as suggested by @PyvesB) and reuse _requestSvg with a custom value matcher, so no API key is required.

Live tests

@jNullj requested at least one live test per service. The tester now includes live tests for all three badge types (hitting the real WakaTime endpoints), plus mocked tests covering SVG parsing, unparseable responses, and 404s. The user badge live test uses the public profile of WakaTime's creator (@alan).

WakaTime
  [live] user coding time
    ✔
  [live] project coding time
    ✔
  [live] repo coding time
    ✔
  [mocked] parses coding time from an SVG badge
    ✔
  [mocked] unparseable svg response
    ✔
  [mocked] unknown user
    ✔

Attribution

This is based on @ashif323's original contribution in #11790. Their commits are credited with a Co-authored-by trailer in the commit.

Adds support for the public WakaTime badge SVG endpoints:

- /wakatime/user/{user}
- /wakatime/user/{user}/project/{project}
- /wakatime/github/{owner}/{repo}

The services extend BaseSvgScrapingService and include live tests against
the real WakaTime endpoints, as requested during review. This revives the
work originally proposed in badges#11790.

Closes badges#11722

Co-authored-by: Mohammad Ashif iqbal <129711879+ashif323@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 ✨ Thanks for your contribution to Shields, @setchy!

Generated by 🚫 dangerJS against 45aebab

@setchy
setchy force-pushed the feat/wakatime-badges branch from b26e0d0 to 29011c2 Compare October 12, 2026 12:17
The user badge id is not listed on the share page; it is included in the
badge snippet on your WakaTime profile. Use the WakaTime creator's public
profile for the example and live test.
@setchy
setchy force-pushed the feat/wakatime-badges branch from 29011c2 to 45aebab Compare October 12, 2026 12:19

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Wakatime badges

1 participant