Skip to content

feat(wakatime): add time-based badges for user and project (#11722)#11790

Open
ashif323 wants to merge 1 commit intobadges:masterfrom
ashif323:feat/wakatime-time-badges
Open

feat(wakatime): add time-based badges for user and project (#11722)#11790
ashif323 wants to merge 1 commit intobadges:masterfrom
ashif323:feat/wakatime-time-badges

Conversation

@ashif323
Copy link
Copy Markdown
Contributor

@ashif323 ashif323 commented Apr 7, 2026

Description

Adds support for WakaTime time-based badges for both user and project, addressing issue #11722.

WakaTime provides public badge endpoints in SVG format:

  • https://wakatime.com/badge/user/{uuid}.svg
  • https://wakatime.com/badge/project/{uuid}.svg

Since no JSON endpoint is available, this implementation fetches and parses the SVG response to extract the coding time text.

Features

  • Supports both:
    • /wakatime/user/{uuid}
    • /wakatime/project/{uuid}
  • Extracts coding time directly from SVG
  • No API key required (uses public badge endpoints)
  • Includes test coverage for valid and invalid responses

Example

/wakatime/user/73d84531-5bb3-4938-91c9-5ca9e6507df9

Notes

  • SVG parsing is used due to absence of a JSON API
  • Cache duration set to 1 hour

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Warnings
⚠️

This PR modified service code.
Please run tests by including affected services in the pull request title.

Messages
📖 ✨ Thanks for your contribution to Shields, @ashif323!

Generated by 🚫 dangerJS against ef770ac

@ashif323
Copy link
Copy Markdown
Contributor Author

ashif323 commented Apr 7, 2026

All checks are passing

Implemented WakaTime time-based badges using SVG parsing since no JSON endpoint is available.

Supports both:

  • /wakatime/user/{uuid}
  • /wakatime/project/{uuid}

Ready for review

@ashif323 ashif323 force-pushed the feat/wakatime-time-badges branch from 26939c9 to 55805dd Compare April 9, 2026 17:48
@ashif323 ashif323 changed the title feat(wakatime): add time-based badges for user and project (#11722) feat(wakatime): add time-based badges for user and project [WakaTime] (#11722) Apr 9, 2026
@ashif323 ashif323 force-pushed the feat/wakatime-time-badges branch 3 times, most recently from f17e998 to bba12d9 Compare April 9, 2026 19:04
@ashif323 ashif323 changed the title feat(wakatime): add time-based badges for user and project [WakaTime] (#11722) feat(wakatime): add time-based badges for user and project (#11722) Apr 9, 2026
fix: resolve lint issues

chore: trigger CI rerun
@ashif323 ashif323 force-pushed the feat/wakatime-time-badges branch from bba12d9 to ef770ac Compare April 10, 2026 04:54
@PyvesB
Copy link
Copy Markdown
Member

PyvesB commented Apr 11, 2026

Hello @ashif323! 👋🏻 Thanks for the contribution! Would it be possible to leverage BaseSvgScrapingService in this case?

@PyvesB PyvesB added the service-badge New or updated service badge label Apr 11, 2026
@ashif323
Copy link
Copy Markdown
Contributor Author

Hi @PyvesB 👋

Thanks for the review! I looked into BaseSvgScrapingService — could you point me to an existing service that uses it so I can follow the same pattern? I want to make sure I implement it correctly before pushing the update.

@jNullj
Copy link
Copy Markdown
Member

jNullj commented Apr 11, 2026

you can search the codebase for classes extending BaseSvgScrapingService
some examples i could quickly find are TravisComBuild, Netlify and ReadTheDocs to name a few...

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

Labels

service-badge New or updated service badge

Development

Successfully merging this pull request may close these issues.

3 participants