Skip to content

nefarius/GitHubLastChangeWidget

Repository files navigation

GitHubLastChangeWidget

.NET Static Badge

Web service that generates an SVG of latest GitHub repository activity.

Features

  • Generates an SVG summary of the recent commit activity for a GitHub repository
  • In-memory caching of GitHub API responses for an hour to not trigger rate limits
  • Customization of basic attributes via query parameters
  • Light and dark mode color schemes can be configured client-side (see examples)

Limitations

  • Private repositories are not supported for security reasons
  • Date rendering is done server-side so the Browser local time can not be taken into consideration (all dates are in UTC)
  • Integration into responsive designs will not work properly since the server lacks information if it got fetched for Desktop, Tablet, Smartphone etc.

Demo

Repository activity

Embed with support for color scheme preference

GitHub-flavoured Markdown

Insert this snippet into your README.md; the first URL will be used when the page is in dark mode, the 2nd for light and the 3rd is the fallback URL if detection didn't result in success:

<picture>
    <source media="(prefers-color-scheme: dark)"
            srcset="https://ghstats.api.nefarius.systems/widgets/github/nefarius/GitHubLastChangeWidget/changes/latest?foregroundColour=%23C4D1DE">
    <source media="(prefers-color-scheme: light)"
            srcset="https://ghstats.api.nefarius.systems/widgets/github/nefarius/GitHubLastChangeWidget/changes/latest">
    <img alt="Repository activity"
         src="https://ghstats.api.nefarius.systems/widgets/github/nefarius/GitHubLastChangeWidget/changes/latest">
</picture>

Material for MkDocs

If you added a color palette toggle and want to show different images for light and dark color schemes, you can append a #only-light or #only-dark hash fragment to the image URL:

![Repository activity](https://ghstats.api.nefarius.systems/widgets/github/nefarius/GitHubLastChangeWidget/changes/latest#only-light)
![Repository activity](https://ghstats.api.nefarius.systems/widgets/github/nefarius/GitHubLastChangeWidget/changes/latest?foregroundColour=%23b5b3b0#only-dark)

Public instance

I'm hosting an instance of this project at https://ghstats.api.nefarius.systems/ which you can consume:

https://ghstats.api.nefarius.systems/widgets/github/{username}/{repository}/changes/latest

Like any other of my public web services it only logs an absolute minimal amount required for debugging purposes and I'll never sell your data out to the big boys 😉

If you like this idea and want to keep my public instance happy, up and running consider making a donation 💸

Resources

About

Generates an SVG of latest GitHub repository activity.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •