Skip to content

ankitsumitg/github-user-contributions

Repository files navigation

GitHub Contrib

  • I'm partially scaling back this project due to recent changes by GitHub in the way pages are fetched on GET requests, making it somewhat challenging to integrate new updates seamlessly.
  • I will utilize the GitHub API key to retrieve and store the count and this will be restricted to tracking personal lifetime count only.
  • Other people who want to use the lifetime count can fork the project and make changes accordingly.
Old Part
  • Simple api to get GitHub user contributions ( No GitHub api key is needed ).
  • Simply use the raw Json once your username is updated. ( Typically, within a minute or so )
  • Any help/suggestions are welcome ⚡ 👍🏻

Usage

  • Comment your username in the discussion thread
    • Format: @username
    • This is a one time process only
  • Wait for the python_build workflow to complete
    • Workflow will take about 1 minute to complete
    • Your contributions will be updated once workflow completes
  • Check the end-points with your username mentioned below
  • Since the response is in json, you can use it however you like it!
  • Also, your contributions will be updated every day at 00:00 UTC 😀

Endpoints

  • These are the endpoints that you can use with your username:
  • Right now the response has
    • username: str
    • fullname: str
    • contributions: int
No. Endpoint Parameters Description Example
1 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/YYYY/MM/DD.json username YYYY MM DD Contribution for a particular Day https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/ankitsumitg/2022/07/17.json
2 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/YYYY/MM.json username YYYY MM Contribution for a particular Month https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/ankitsumitg/2022/07.json
3 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/YYYY.json username YYYY Contribution for a particular Year https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/ankitsumitg/2022.json
4 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/LASTYEAR.json username Contribution since Last Year https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/ankitsumitg/LASTYEAR.json
5 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/LIFETIME.json username Contribution all Lifetime 😎 https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/ankitsumitg/LIFETIME.json

Sample response for 1st example endpoint

  {
    "username": "ankitsumitg", 
    "fullname": "Ankit Gupta", 
    "contribution": 9
  }

Support for shields.io badge

Contribution Badge

<img src="https://img.shields.io/badge/dynamic/json?color=green&label=contribution&style=for-the-badge&logo=github&query=contribution&url=https://raw.githubusercontent.com/ankitsumitg/github-user-contributions/main/api/v1/username/LIFETIME.json" alt="Contribution Badge">
  • Change the url parameter accordingly
  • Refer shields.io Dynamic badge documentation to make the badge to your liking 😍

Internal Working

  • Internally, the github-user-contributions runs a python script that crawls and scrapes the skyline-contributions from GitHub users page
  • Everything happens asynchronously
  • python_build workflow runs the script and updates the user contributions

Notes

  • If a user did not make private contributions visible on GitHub profile, then only public contributions will be counted

License

License: MIT

Contributors

  • GitHub Link
  • Simply use the raw Json once your username is updated. (Typically, within a minute or so. See: Usage)
  • Any help/suggestions are welcome ⚡ 👍🏻
  • Would really appreciate any improvements/contributions 😊
  • Types
    • Day Wise
    • Month Wise
    • Year Wise
    • Since Last Year
    • Lifetime
  • Do checkout 😊👍🏻

About

Gets GitHub total contributions of a user profile without using github api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages