Giter Site home page Giter Site logo

Comments (19)

anuraghazra avatar anuraghazra commented on May 21, 2024 2

@1UC1F3R616 it is currently shows 1years total commit, its a limitation of github api. checkout #15 for more info

from github-readme-stats.

omidnikrah avatar omidnikrah commented on May 21, 2024 2

@anuraghazra I think, at the moment it's better to change "Total Commits:" to "Total Commits (last year):".

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

Hmm it should be fine.. it fetches the data from Github GraphQL api so it can't be invalid. although it is possible that you contributed to github organizations and i think those are not counted. #1

Stat

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

Ah okay, very strange because PRs count is close to correct but commit count is still far off even if you exclude org commits.

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

@anshumanv i think i got it. the issue is that github only returns last years contribution commits

{
  user(login: "anshumanv") {
   contributionsCollection(from: "2016-08-13T14:31:00Z", to:"2020-07-10T08:35:06.094Z") {
      totalCommitContributions
    }
  }
}

I can set from and to variables in the query but github does not allow more than one year's contributions to be shown at once

I have to find a way to fix this. do you have any ideas on this?

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

@anshumanv what i did is that looped through all the years and fetched the commits individually and seems kinda close.

github-readme-issue

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

Yes, this is the basic brute force solution but I think you'll run into API rate limit after a while if you do this for every user.

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

Maybe you can give an option for users to use their own tokens?

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

No i don't think i can hit the rate limit because it's already authenticated by the server... i set auth token in env.

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

Also i don't think i can give users an option to add their own tokens because that would be a huge security vulnrability if someone did like this /api?username=abc&token=SECRET_TOKEN because the url would be public

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

No i don't think i can hit the rate limit because it's already authenticated by the server... i set auth token in env.

Yep even that doesn't give you infinite requests 😄 , IIRC you get 5k req per hour which can work for now till this gets really popular.

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

Also i don't think i can give users an option to add their own tokens because that would be a huge security vulnrability if someone did like this /api?username=abc&token=SECRET_TOKEN because the url would be public

Yes, only option is for user to host their own app but that seems like an overkill for now

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

And anyways tokens in request params will be deprecated in near future. You have to send it in body.

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

No i don't think i can hit the rate limit because it's already authenticated by the server... i set auth token in env.

Yep even that doesn't give you infinite requests , IIRC you get 5k req per hour which can work for now till this gets really popular.

Just hope not everyone would have commits from 1980's like yours 😆 your account will hit the api 42 times 😆

from github-readme-stats.

anshumanv avatar anshumanv commented on May 21, 2024

Just hope not everyone would have commits from 1980's like yours 😆 your account will hit the api 42 times 😆

Lol, that was when in my 1st year I committed using a messed up system clock, forgot to revert it 😥

Maybe I should take care of it real quick 😛

from github-readme-stats.

1UC1F3R616 avatar 1UC1F3R616 commented on May 21, 2024

@anshumanv It's showing yearly commit for me I see not total from when I started
Is this a feture for future pr or I using some wrong parameter?

from github-readme-stats.

vasugamdha avatar vasugamdha commented on May 21, 2024

I don't know much, but is it possible that before people use it, they have to fork it, modify the auth token and then request? So like, in future you don't have to face rate limit of 5k!? I might even be wrong, conceptually.

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

Hey @vasugamdha Let's discuss about rate limit on another issue maybe? you can open an issue to discuss it or hop into my discord :) https://discord.com/invite/VK4k3Br

from github-readme-stats.

anuraghazra avatar anuraghazra commented on May 21, 2024

Fixed in #211

from github-readme-stats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.