Search code examples
gitgithubbadgereadmeshields.io

Dynamic Badges GitHub


I have been using shields.io to build my GitHub badges in the README files, but only for badges such as license and version.

Now, my goal is to build dynamic badges on the number of watches of a specific repo, in a way that the number updates whenever a new person is watching the repo.

What is the best way to do it?


Solution

  • Just solved the problem.

    For the repo Project-CodeIgniter-CMS and user goncaloperes, I have used the following code:

    Watches:

    [![GitHub Watches](https://img.shields.io/github/watchers/goncaloperes/Project-CodeIgniter-CMS.svg?style=social&label=Watch&maxAge=2592000)](https://github.com/goncaloperes/Project-CodeIgniter-CMS/watchers)
    

    Starts:

    [![GitHub Starts](https://img.shields.io/github/stars/goncaloperes/Project-CodeIgniter-CMS.svg?style=social&label=Star&maxAge=2592000)](https://github.com/goncaloperes/Project-CodeIgniter-CMS/stargazers)
    

    Forks:

    [![GitHub Forks](https://img.shields.io/github/forks/goncaloperes/Project-CodeIgniter-CMS.svg?style=social&label=Fork&maxAge=2592000)](https://github.com/goncaloperes/Project-CodeIgniter-CMS/network)