Skip to content

pa-ulander/yaghvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

680 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet Another Github Visitor Counter

TestsTest CoverageDeployType Coverage

A Laravel-based GitHub profile visitor counter and github repository visitor counter that generates customizable SVG badges to display on your GitHub profile or in a repository's README.

Made only for fun and to try out new latest Laravel and testing utilities, like PEST & Dusk.

Usage

Add this to your profile page README.md to show a visitor counter badge:

![](https://ghvc.kabelkultur.se?username=your-username)

It will generate a visitor counter badge that looks like this:

Usage per repository

Add this to your repository README.md to show a visitor counter badge for a specific repository:

![](https://ghvc.kabelkultur.se/?username=your-username&repository=my-repository&label=my-repository%20Views)

Badge Customization Options

The visitor counter badge can be customized with the following URL parameters:

Parameter Description Default Example Values
username GitHub username (required) ?username=your-username
label Text label displayed on the badge Visits label=Profile%20Views
color Badge right-side (value) color blue color=green, color=ff5500, color=red
labelColor Left-side label background (named or hex no #) blue labelColor=red, labelColor=ffd700
style Badge style for-the-badge style=flat, style=flat-square, style=plastic
base Starting count added to stored counter 0 base=100
abbreviated Abbreviate large numbers (1.2K, 3.4M) false abbreviated=true
repository Repository scope (per‑repo counter) (none) repository=my-repo
logo Data URI image (png,jpg,gif,svg) OR simple-icons slug (none) logo=github, logo=laravel, logo=data:image/png;base64,iVBOR...
logoSize Logo sizing: auto (SVG adapt) or fixed px (8–32) 14 logoSize=auto, logoSize=32
logoColor Recolor SVG/simple-icon logo (named or hex, no #) f5f5f5 logoColor=red, logoColor=ff8800, logoColor=brightgreen

Examples

Different Styles style

StyleExampleMarkdown
for-the-badge ![](https://ghvc.kabelkultur.se?username=your-username&style=for-the-badge)
flat ![](https://ghvc.kabelkultur.se?username=your-username&style=flat)
flat-square ![](https://ghvc.kabelkultur.se?username=your-username&style=flat-square)
plastic ![](https://ghvc.kabelkultur.se?username=your-username&style=plastic

Custom Colors color

Named Color Example Markdown
brightgreen brightgreen ![](https://ghvc.kabelkultur.se?username=your-username&color=brightgreen)
red red ![](https://ghvc.kabelkultur.se?username=your-username&color=red)
orange orange ![](https://ghvc.kabelkultur.se?username=your-username&color=orange)
yellow yellow ![](https://ghvc.kabelkultur.se?username=your-username&color=yellow)
Hex Color Example Markdown
ffd700 ffd700 ![](https://ghvc.kabelkultur.se?username=your-username&color=ffd700)
e34234 e34234 ![](https://ghvc.kabelkultur.se?username=your-username&color=e34234)
6a0dad 6a0dad ![](https://ghvc.kabelkultur.se?username=your-username&color=6a0dad)
00b7eb 00b7eb ![](https://ghvc.kabelkultur.se?username=your-username&color=00b7eb)

Note

You must specify hex colors without the # prefix (e.g., f000ff instead of #f000ff).

Custom Label Color labelColor:

Label Color Example Markdown
00aaff label 00aaff ![](https://ghvc.kabelkultur.se?username=your-username&labelColor=red)
green label green ![](https://ghvc.kabelkultur.se?username=your-username&label=Visitors&color=orange&style=for-the-badge&labelColor=green)
yellow label yellow ![](https://c21572a0a33b.ngrok-free.app?username=your-username&&color=blue&style=for-the-badge&labelColor=yellow)

Color Combinations

All the named colors supported and the corresponding hex values:
Color Name Hex Color Name Hex
brightgreen #44cc11 green #97ca00
yellowgreen #a4a61d yellow #dfb317
orange #fe7d37 red #e05d44
blue #007ec6 lightgray #9f9f9f
lightgrey #9f9f9f gray #555555
grey #555555 blueviolet #8a2be2
success #97ca00 important #fe7d37
critical #e05d44 informational #007ec6
inactive #9f9f9f

Any hex color can be used instead 🎨

Custom Label label

Custom Label Example Markdown
Profile%20Visitors Profile Visitors ![](https://ghvc.kabelkultur.se?username=your-username&label=Profile%20Visitors)
Chocolate%20Cookies Chocolate Cookies ![](https://ghvc.kabelkultur.se?username=your-username&label=Chocolate%20Cookies)
Horsepowers Horsepowers ![](https://ghvc.kabelkultur.se?username=your-username&label=Horsepowers)

Number Abbreviation

Display large numbers in abbreviated format (1K, 1.5M, etc.):

![](https://ghvc.kabelkultur.se?username=your-username&abbreviated=true)

Logo or icon usage

Supported image types: png | svg

The logo parameter supports the following input;

Simple Icons

Any simple‑icons slug. Like logo=github, logo=laravel ...etc.

Slug Example Markdown
github label yellow ![](https://ghvc.kabelkultur.se?username=your-username&logo=github)
laravel label yellow ![](https://ghvc.kabelkultur.se??username=your-username&label=Visits&color=orange&style=for-the-badge&logo=laravel)

Simple Icons or svg's with color logoColor

When using a simpleicon slug, or logo/icon with a fillable format, ie svg, you can also set the logoColor.

Note

logoColor only affects the fill color on simple icon slugs or svg logos.
If you try to use it on a png logo it will have no effect.

Slug Example Markdown
refinedgithub label yellow ![](https://ghvc.kabelkultur.se?username=your-username&label=Visits&style=for-the-badge&logo=refinedgithub&logoColor=ffff00)
laravel label yellow ![](https://ghvc.kabelkultur.se/?username=your-username&label=Visits&style=for-the-badge&logo=laravel&logoColor=red)

Logo from a data URI (raw or URL‑encoded):

You can use your own custom logo by embedding it as a data URI.

  • Full data URI - Example: logo=data:image/png;base64,iVBOR...
  • Raw base64 blob without the data: prefix - Example: logo=iVBORw0KGgoAAAANSUhEUgAA...
  • Urlencoded base64 blob with data: prefix - Example: logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc...

Both works, but the first is preferred as it needs less processing and therefore gets rendered a little bit quicker.

Logo from a base64 encoded and urlencoded SVG using full data URI

This is the "proper" and recommended way to add a logo or icon to your badge.

![](https://ghvc.kabelkultur.se?username=your-username&label=Visits&style=for-the-badge&logoColor=ffff00&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb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0IDEyIDE1LjUgMTJDMTQuNjcxNiAxMiAxNCAxMy4xMTkzIDE0IDE0LjVDMTQgMTUuODgwNyAxNC42NzE2IDE3IDE1LjUgMTdaIiBmaWxsPSIjMDAwMDAwIi8%2BDQo8L3N2Zz4%3D)

counter badge with yellow octocat as logo

Logo from a raw base64 encoded PNG using full data URI

![](https://ghvc.kabelkultur.se/?username=your-username&label=Visits&style=for-the-badge&color=orange&labelColor=green&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAA7AAAAOwBeShxvQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKQSURBVFiFtdffi1VVFAfwzz3MOA4yDWr5A6VMHX0oIhlhBkPxReYlgp6MKFHM8Af4qqSI/gGJT9pTPkpvPUmo5NNERk1UoGFagSKi5kihAyP3Tg/7HOfM8ez7y3u/sOCw14/vOuvsvdY+Fa2hB8N4C6uwMF2fxN/4BT+h2mLchhjFWTzCTAOZxJcY6QTxm7jUBGlMLuKNdogrOIzpFyDPZBr7WyGfh686QFyUM+htRN6Dr7tAnsk5obpRnOoieSZHYuTvolYwPoTF+BgTLZBM4KPU93BBV8W2jDQrRz+u4bVCUqO4kj4n2CX0gB/xFx6mukV4HRvxq3Bka6luE8YLcX/DBrl+cTDyJmsj1WoF6yKxd2YGFdyIGG3uQAJbIrGvo5IIJVpT4lg1W8YXQVV5ax7CSIKxiONpz3+7djCOLyK6MbigvERlVWkXQxGObwhTrKi43UHyDHdKeP5M8HKJ8f0uJHCvZO2VROj9RQx0IYGXStb6ErPNJI8lGvTsFpGkMYt4mOBBiWIAb3cwgWEsKFm/l+BqxOmDDiawPbJ+FQ4oPyJPdOYoDmEqwrGP0KuLUzCTP4TLZ7tYjZuR2DW5WfNtTjGO73NJ/SvM8KUtEC/HMfwXIZ8R7ovP8H5OcR6vYoe5d8Iqfsbnyk9IBSeFcRyraF7eKzpfzim/wyBOlDjurfPmnzZBPCPctJ/DenM3yx5hA53AXTzGD+p/ipVNkE8J+64UH5ot3y0sSwmH8I7G94PeBuQ1TRzvz3IOvwv7Y1D4TCvU75A9DRI41Ig8w27xn5KeOn6xCjyVnvlWsFXoA8VgZcMrQ1+J/fU0Vlvox3H8kwvY12QCD4ReML9d8mIin6jzU5HD0dS2v5nA/wOcRnFtFu2FpwAAAABJRU5ErkJggg==)

counter badge with yellow octocat as logo


Note

The above examples will work also if the data uri part: data:image/png;base64, is omitted and only the raw encoded string is used. But that is not recommended as it takes longer to process, and the logo can also be refused by validation or just ignored.
The recommended way is to use the full data uri and also urlencode the logo string.

Logo size options

Use the logoSize parameter to control how large the logo appears on your badge:

logoSize=auto – keeps the logo’s original proportions while fitting it to the badge. logoSize=12 – sets the logo to a specific size (any number from 8 up to 32). Handy when a logo feels too large or too small.

Examples:

...&logo=github&logoSize=auto
...&logo=github&logoSize=12

Try different values, refresh the badge, and pick the look you like best.

Example with fixed size (28px):

![](https://ghvc.kabelkultur.se?username=your-username&logo=<your-encoded-image-data-uri>&logoSize=28)

Limitations

Some limtiations are applied:

  • Maximum decoded logo size: 10 KB. Larger images are silently ignored.
  • Maximum raster (PNG width/height: 32×32 pixels. Larger raster images are silently ignored (not resized).
  • Supported formats: png and svg. Anything else is ignored without error.
  • Rejected / ignored logos never break the badge – it simply renders without the logo.
  • Basic rate limiting protects the service. If you see HTTP 429, reduce request frequency.

Full Customization Example

![](https://ghvc.kabelkultur.se?username=your-username&label=Visitss&labelColor=blue&color=orange&style=for-the-badge&abbreviated=true&logo=github&&logoColor=ffff00&logoSize=18)

Self-hosting

This is a Laravel-based application that can be self-hosted.
See the project structure and Docker configuration for details on how to set up your own instance.
Documentation for development and self-hosting is in the making and will be added at some point.
If you know basic Laravel and Docker it should be fairly straightforward to get it up and running.
Clone away and have badges of fun!

Acknowledgments

Badges for the cool Poser library. A php library that creates badges.

Awesome Badges a curated list of awesome badge things.

Simple Icons SVG icons for popular brands.

License

MIT

About

Visitor counter badges for readme's in github profiles & repositories.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages