/CP-Badges

Support for Competitive Coding badges to add in Github readme or portfolio websites.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

CP-Badges

What if there are badges on Github profile that show our Codeforces ratings with the rating colour as well?

So I decided to make my own!

This repo helps you to create your custom profile badges with Max rating in Codechef, Codeforces and many more.

Maybe you can flaunt more with your coding badges now.

Show some ❤️ and ⭐ the repo to support the project


🛠 Installation & Deploy on Ubuntu 22

apt install python3-pip
pip install -r requirements.txt
cp my-cp-badges-server-py.service /usr/lib/systemd/system/
sudo systemctl enable my-cp-badges-server-py
sudo systemctl daemon-reload

sudo systemctl status my-cp-badges-server-py
sudo systemctl start my-cp-badges-server-py
sudo systemctl stop my-cp-badges-server-py
sudo systemctl restart my-cp-badges-server-py

systemctl --type=service --state=running

journalctl -u my-cp-badges-server-py     # to see full log from systemctl status service
journalctl -u my-cp-badges-server-py -b  # to see only log messages for the current boot
journalctl --vacuum-time=1d     # Retain only the past one day
journalctl --vacuum-size=500M   # Retain only the past 500 MB

systemd - Process management


Endpoints

https://cp-logo.vercel.app/codeforces/<user_name>
https://cp-logo.vercel.app/codechef/<user_name>
https://cp-logo.vercel.app/atcoder/<user_name>
https://cp-logo.vercel.app/topcoder/<user_name>
https://cp-logo.vercel.app/yukicoder/<user_name>
https://cp-logo.vercel.app/uri/<user_name>
https://cp-logo.vercel.app/leetcode/<user_name>
https://cp-logo.vercel.app/leetcode-cn/<user_name>

Usage

[![Badge](https://cp-logo.vercel.app/codechef/gennady.korotkevich)]

This corresponds to

Badge

You can also show the logo along with the website name and rating by including the query parameter with the URL ?logo=true

For example

[![Badge](https://cp-logo.vercel.app/codechef/gennady.korotkevich?logo=true)]

This corresponds to

Badge

You can add custom links also to the badge for reference :

[![Badge](https://cp-logo.vercel.app/codechef/gennady.korotkevich)]
(https://www.codechef.com/users/gennady.korotkevich)

This will add a link to the badge

Badge

Fun Fact

The colour of the badge changes as your maximum rating changes according to the website policy.

Some examples are -

Badge Badge Badge

Badge Badge Badge

Badge Badge Badge

Badge Badge Badge

Badge Badge Badge

Badge Badge Badge

Badge

Badge

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GPL-3.0 License

Star the Repo in case you liked it :)