DenverCoder1 / github-readme-streak-stats

🔥 Stay motivated and show off your contribution streak! 🌟 Display your total contributions, current streak, and longest streak on your GitHub profile README
https://streak-stats.demolab.com
MIT License
4.66k stars 721 forks source link

Not sure if bug or misunderstanding of how to use. #448

Closed ijsbol closed 1 year ago

ijsbol commented 1 year ago

Description Hey all, trying to add my streak to my profile at the moment and i'm using the below; <img src="https://streak-stats.demolab.com/?user=Scrumpyy&theme=holi-theme&hide_border=true&ring=EB5454&background=EB545400">

When I directly go to https://streak-stats.demolab.com/?user=Scrumpyy&theme=holi-theme&hide_border=true&ring=EB5454&background=EB545400 the expected image loads, however when rendering it on my profile it fails to, upon further inspection it appears that the camo.githubusercontent.com is returning "Error Fetching Resource" -- not sure if this is a bug with my implementation or with the website itself.

DenverCoder1 commented 1 year ago

GitHub has a time limit on how long it will give for the image to load. I think the issue is probably because your contribution years go all the way back to 1970 (streak stats can only fetch 1 year at a time, so it's 1 request per year of contributions).

Changing the dates on those backdated commits would probably resolve the issue, but maybe something like streak stats adding the ability to be able to provide a minimum year to check or something could help?

ijsbol commented 1 year ago

Haha- yeah that makes sense.

but maybe something like streak stats adding the ability to be able to provide a minimum year to check or something could help?

This would be a nice addition.

DenverCoder1 commented 1 year ago

Feel free to let me know what you think of the proposed solution (#449)

It will exclude years before account creation which limits the amount of requests that need to be made.

In this case, it would count contributions from 2019-2023 (5 requests) instead of 1970-2023 (54 requests)

image

If you really want, maybe I could throw in a exception to check the year 1970 specifically, but for the most part I think anything between 1971 and account creation is not really useful to check.

ijsbol commented 1 year ago

That works for me! The 1970 exception isn't really needed but if it's not too much of an issue to implement then it would be a nice addition.

DenverCoder1 commented 1 year ago

Thanks for reporting the issue.

You may need to give it some time for GitHub's cache to reset (or change the URL slightly to force it to refresh), but with the latest version, it should only fetch years from the account creation year to the current year and also the first contribution year if the first contribution is before 2005. So for yours, it will check 1970 and 2019-2023.