I've seen many people using this project and i'm really happy with it but the one thing i'm not really happy with is that 90% of them actually did not even attributed the project in any way, and a good chunk of people don't even know the origin of the stats they are using.
i know i might sound like a jerk but this project i'm giving time and effort to develop and maintain & and i'm doing this for free,
So i think the project deserves proper credits/attributions.
So for this reason i was thinking that i should show a attribution message at the bottom of the card like this :-
People can actually hide the attribution text with a condition, they have to star the repo.
if a user starred the repo then he/she would not see any attribution message but if not starred then we would show attribution text. :D
So i would have some logic to check if the current user starred the project before showing the attribution text, i'm not the only one who did implemented this logic i've seen many similar projects doing the same, so i was thinking to enforce people to at least visit the repo once i would do this.
I just wanted to know what you all think about this, and if you have any thoughts or you wanna add something please comment below.
mentioning few contributors for their opinions: @filiptronicek @nombrekeff @garvit-joshi @ApurvShah007
I think it is a nice thing when you can disable it, if we disclose that, I think it is a nice addition. It isn't much disruptive, I like it. @anuraghazra
I really liked your Idea @anuraghazra ๐งก
The card looks nice with the credit. One more thing, will it be default to not show the credits after giving a star to repo .Just add one more parameter to let people decide if they want to show credits or not, after giving star to repo, we will have our choice to show credits.
I completely agree with you @anuraghazra. You deserve every bit of the credit as you have worked so hard. I love the idea and I would love to help and implement it if needed.
Garvit, Yup that's right, I'll also add a option to show the credits, if the user manually set the show_credit options then we can skip the checking if the user is starred to save some milliseconds.
I also agree and I think it's so good and helps other developers to use and find it easily.
I like the idea, and the card looks good with the credits. Not very disruptive
It is a good idea
i agree and it's a good idea
I woudls sugges to show a shortened version. The username/reponame is long, maybe sometrhing like git.io/readme-stats
@SirWindfield yup good idea, i like this since it's also a direct link instead of an arbitrary username/reponame,
btw how did you get the short url to be like that? because git.io generates random urls AFAIK
curl https://git.io/ -i -F "url=https://github.com/anuraghazra/github-readme-stats.git" -F "code=readme-stats". it's behind a shell alias on my system, so I can use git-io url name :)
Okay everyone i have a nicer solution to this, the checking if user is starred method is pretty nice but it would require us to do a API request to check if user is starred the repo, and i don't really want any performance degradation just because of showing credits.
So second approach would be an extra query param to disable the credits but it would be something like this
?poweredby_githubcom_anuraghazra_github_readme_stats=true
Yup very long
Approach looks nice, but the query will become extra long if there are more query attached to it.
Approach looks nice, but the query will become extra long if there are more query attached to it.
Hmm yes. it would make it a bit longer, but it would make sure that whoever is copy pasting the link he/she would know the origin :thinking: I'm all ears for more ideas tho, which does not effect performance :)
I dunno, in that case it could be just left out as well. I mean, people can just append it without starring, so I see no gain there tbh. It would just complicate the code base and bloat it without any real value.
Do you happen to have statistics on how often your API is called per day, per hour, per minute? If it is still under 5000 an hour, you're fine. And that's probably the easiest way.
IMO the best approach would be to run a scheduled fetcher on the running instance you're hosting, that fetches the API every 24/12 hours and caches the results (just the username). If someone makes the request, it checks if the username is inside the cached values and removes the URL. If not, it keeps the URL. It would result in a delay but I think that is a good compromise if you want to ensure that the users actually have your repository starred @anuraghazra
Like, a simple JSON file, an array of usernames. Load it once every X hours from disk to update it. And just keep checking the loaded instance every time someone makes a request.
Like, a simple JSON file, an array of usernames. Load it once every X hours from disk to update it. And just keep checking the loaded instance every time someone makes a request.
I can do that, probably i have to write a Github Action to prefetch all the names who actually starred the repo.
Ye, you could like create a workflow that fetches the list on schedule and pushes it to the repository. Or just some JS that uses the GraphQL API and returns the list. You already run a server, you can already use JS + timer for example. Or other technology. No need to write a whole action.
@SirWindfield We cannot fetch all the stargazer count from api because they are limited to 100 paginations and i also don't want to run the request on runtime because of the performance issue thats why i would like to prefetch all the data with github actions
Where did you find the pagination limit? I am skimming the documentation right now and I do not see any mention of pagination limits. Yes, items per page are limited, but not the number of pages.
Here
And you have to set the pagination which is 100max
query {
repository(name:"github-readme-stats", owner: "anuraghazra") {
stargazers(first: 100) {
nodes {
login
}
}
}
}
The API uses Relay based pagination which uses cursors:
query {
repository(name:"github-readme-stats", owner: "anuraghazra") {
stargazers(after:"Y3Vyc29yOnYyOpIAzg2dds8", first: 100) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
nodes {
login
}
}
}
}
The first is the number of elements per page (from the front). You can get the last n as well using last. You have to also print the endCursor, which is the unique id of the last object returned. Pass that down to after to get the next 100 elements from the API. If you run it once without the after and another time with, you will notice that it returns 100 different usernames.
Fetching the data isn't an issue, I know I can use the cursor or just loop through each iteration to get all the stargazers usernames but the main problem is performance not the data fetching. That's what I'm also facing in #15
There are 1.7k stargazers and the number of requests we have to make will increase as the stargazers count increases and each graphql request will cause a performance delay and hit the api.
So it's just not suitable to run the operation on runtime. We can just do it all in GitHub action to add all the user names in one file and we can then locally fetching them. We can also make the file an object with keys so that access is O(1)
I agree with you @anuraghazra as It'll have a bad impact upon loading of the stats too.
I've been thinking about this a bit, this is just my point of view and might not align with yours.
I think forcing the users into starring the project to hide the attribution is not the way to go, as it makes the project feel a bit "starrcentric", I know the importance of a project being appreciated and supported but we should not force people to like something just to be able to hide the attribution. It feels wrong to me ๐
Also most people wont mind showing the attribution if its not too obstrusive.
If we hide the attribution it will somewhat defy the purpose of the attribution as people will not see who built it, yeah we have a star but it will not bring more people to the project.
If we add the option to hide it:
If we don't add the option to hide it:
https://github-readme-stats.anuraghazra.com or similar, so even if people don't add attribution the link points to your site. Similar to shield.io, they don't show attribution but everyone knows because of the domain.git.io/readme-stats. Or just something like: With โค๏ธ by @anuraghazra or even better By @anuraghazraWhat do you guys think about this?
I think forcing the users into starring the project to hide the attribution is not the way to go, as it makes the project feel a bit "starrcentric", I know the importance of a project being appreciated and supported but we should not force people to like something just to be able to hide the attribution. It feels wrong to me sweat_smile
This is not the final decision tho,
Also i'm not the first one to do this stargazer checking, i've seen lot of projects which relies on github api so i was just tinkering with the idea.
Thats why i proposed this solution https://github.com/anuraghazra/github-readme-stats/issues/90#issuecomment-661124157
You could set up a custom domain, for example: https://github-readme-stats.anuraghazra.com
I don't think we can switch to custom domain first because lot of people are already using the vercel domain & second i cannot buy a domain right now.
Or just something like: With โค๏ธ by @anuraghazra or even better By @anuraghazra
This is good but i don't want to brand myself i just want people to know the origin of the stats, thats why git.io link would be preferable. also people might not like another user's name on their readmes so the message would be "Powered by git.io/readme-stats"
A little bit shorter:
โก by git.io/readme-stats
A little bit shorter:
by git.io/readme-stats
Looks cool!
This is not the final decision tho,
Also i'm not the first one to do this stargazer checking, i've seen lot of projects which relies on github api so i was just tinkering with the idea.
Yup, I know, that's why I wanted to throw my opinion to the table. I think the concept is pretty cool though.
Thats why i proposed this solution #90 (comment)
Oh, I missed this comment, I kinda like that approach the most.
This is good but i don't want to brand myself i just want people to know the origin of the stats, thats why git.io link would be preferable. also people might not like another user's name on their readmes so the message would be "Powered by git.io/readme-stats"
Agree, did not thing about the username in the readme.. good catch.
@SirWindfield the short url is permanent right?
โก by git.io/readme-stats
I like this one better
Yes @anuraghazra, github support can remove it if you ask them though.
No i don't wanted it removed, i like it.
Although i've thought about this url git.io/grs but seems too short lol :p
I thought about that too, it's not bad. I read it as greese xD
yeah lol, readme-stats it ok, it gives users context what the link is about. grs is kinda arbitrary & does not make sense. :p :laughing:
yeah lol, readme-stats it ok, it gives users context what the link is about.
Yep, that's why I removed the github, not needed. But I couldn't come up with something shorter that has the same expressiveness
What about md-stats? In the end, they are stats for markdown more so than for readmes. I could use them in my posts on DEV.to as well.
That could be an alternative
Just throwing ideas.
I think readme-stats is ok, it's more similar to the project name, yes md-stat is good but I think readme-stats matches the project title
yeah, readme-stats is good for me too!
@nombrekeff @SirWindfield
I like it! Pretty nice @anuraghazra
also @filiptronicek i'm going with simple undocumented ?hide_credits=true option
Any suggestions on the parameter name?
Can you try to center it and post some images of it? I.e. center the text with the summary circle. Curious if that is more pleasant to the eyes, it itches me a little bit that it is not centered, but I do get the decision behind it.
__Edit:__ on that note, I am only A+... :(
also @filiptronicek i'm going with simple undocumented
?hide_credits=trueoptionAny suggestions on the parameter name?
I think hide_credits sounds good, an alternative would be just credits = (hidden|shown) (hide|show), but your suggestion is better I think @anuraghazra
Can you try to center it and post some images of it? I.e. center the text with the summary circle.
Tried that does not look nice to me, also users can hide the rank circle so we cannot align to that respect. i think corner looks good
@anuraghazra Vote for config that allows to align it in the center:

__EDIT:__ Is it by design that a card with hidden rank does still create a large border and is not compacted down?
https://github-readme-stats.vercel.app/api?username=anuraghazra&hide_rank=true
Maybe on the left side?
Advantages of left align is also that it does not mess with rank circle, on the right side we have to do lot of manual tweaking to fix on every height
I do think that the middle looks the best to be honest.
Center:
Corner:
Ye, I do like the center one more! :) Any plans on adding it to the other cards as well?
I dislike this idea. I would instead only politely point out in the README that the card should use the link to your repo as the hyperlink ([ card image url ](https://github.com/anuraghazra/github-readme-stats)).
I think that doing that along with some explanation as to why you would appreciate it will trigger most people to actually do that.
I have noticed that default behavior for me was to click the card in order to find out how it was generated. So this should solve it.
There are two reasons as to why I think so:
So I am not sure who the other people are that agreed to the idea, but afaic they are all a little biased towards agreeing with you as they are contributors.
PS I love this project โค
If I would support after you introduced a change like this to promote yourself? No, because I believe open source should not be like that ๐
@creativecreatorormaybenot thanks for your opinions now if you read all of the above messages you should get what i'm doing.
I dislike this idea. I would instead only politely point out in the README that the card should use the link to your repo as the hyperlink ( card image url ).
I think that doing that along with some explanation as to why you would appreciate it will trigger most people to actually do that.
Problem here is that, maybe you are linking the card that's fine i appreciate it, BUT 90% of the people are not doing that. and most of the people does not even know what's the origin of their readme stats card because mostly they get to use this tool by forking other people's readme or reading articles on the internet.
I have noticed that default behavior for me was to click the card in order to find out how it was generated. So this should solve it.
This is not a default behaviour, this would only happen when users would willingly link the image WITH the github readme stats github link.
Open source should not be about being selfish. This kind of attribution does usually not happen in code, so I do not think that it should happen within Markdown, which is also code. Imagine a code project that linked the open source framework it uses on the home screen.
It's not about being selfish, it's about getting the right attribution for work, It happens a lot actually, eg: core-js is a large project and they are literally advertising on the console. (people are mad about it because it makes the terminal console output longer)
If I would support after you introduced a change like this to promote yourself
I'm not promoting anything here, i'm just making sure whoever is using the project on their readme should know its origin and i'm asking for proper attribution.
Also people can disable the attribution message if they want without any hesitation, with &hide_credits=true option
@anuraghazra Thank you for your response ๐๐ฝ
I had indeed already read through the comments here - I wanted to politely point out that I dislike this approach, genuinely. There is not more to it ๐
I disagree with your sentiment about exposure, though. Maybe you feel like you deserve more than 5k stars for this project. This is okay, however, I think that the following is not a correct assumption:
Problem here is that, maybe you are linking the card that's fine i appreciate it, BUT 90% of the people are not doing that. and most of the people does not even know what's the origin of their readme stats card because mostly they get to use this tool by forking other people's readme or reading articles on the internet.
Instead, I would suggest that most of the people that do not come to your repo and leave appreciation actually do not care about it. They are simply not interested in knowing what is behind the project (this is of course only an assumption that I am making ๐ - I just want to throw it in here ๐).
Are you interested in how I discovered your project?
I saw the GitHub stats - searched for it using a search engine, found an article, and came straight to your repo from the article. Before that, I tried to click the stats to find out its origins, which I believe will happen a lot because the mouse pointer turns into a hand.
It's not about being selfish, it's about getting the right attribution for work, It happens a lot actually, eg: core-js is a large project and they are literally advertising on the console. (people are mad about it because it makes the terminal console output longer)
So what is the benefit for other people here? If someone would like to not redirect to another person from their personal README, they will not include the link. If they are fine with it, they will leave it in. IMO the text on the card just makes it ugly (just throwing it in, again - I do not think my opinion has more weight than the opinion of others here ๐๐ฝ).
I think that the following is not a correct assumption:
Well, this is not an assumption, few days ago while writing this issue i opened vercel serverless logs and i literally opened each and everyone's github account to see if they are actually linking/attributing the original repo and sadly none did. & not just that i've seen various youtube videos/articles specifically talking about new github readmes & using github readme stats without actually linking/attributing the project.
just throwing it in, again - I do not think my opinion has more weight than the opinion of others here ๐๐ฝ
Well if you think so then you should change your mindset. I value everyone's opinions whether i agree or not, i also agreed with @nombrekeff about not doing the stargazer checking because it makes the project "starrcentric"
but afaic they are all a little biased towards agreeing with you as they are contributors.
This statement of yours is also not really nice, you can also contribute to the project and become a contributor, but does that changes your opinions & makes you biased towards me? No right?
As a open source community we should only focus on engaging and having healthy discussion instead of concerning about who is biased towards whom.
It's not about me, it's about the project.
I'm really totally fine with your opinions and i really WANT to know your opinions, this is why i created this issue :heart:
I think if your disagreement was followed by a proper solution as @nombrekeff did i would appreciate it more.
What if instead of making the attribution message option Opt-Out we make it Opt-In, if people would prefer to show the attribution and support the project they can enable it otherwise we won't show it.
@anuraghazra I do believe that you have every right to ask for credit when you work so hard on something. Being open source means that you don't change for it and anyone can build on it. But I do not believe that being an opensource dictates no credit. Many many projects have compulsory credits such as many public app and website templates.
Giving credit to the creator should be common behavior and I believe that you should have that feature. It is you being the bigger person by allowing people to opt out of it. I would love to give credits as it does feature on my profile readme too
What is the url parameter to specify, to have the attribution ? I see many suggested throughout the issue, and have tried some.
What if instead of making the attribution message option Opt-Out we make it Opt-In, if people would prefer to show the attribution and support the project they can enable it otherwise we won't show it.
In all honesty, I do not see any problem with having it being opt-out. You started the project and promotion keeps it active and alive. Seeing other open source projects, that little banner won't annoy many people and if it does, they can opt-out. You have to clearly put a how-to somewhere though.
Especially the line that uses the url and the emoji is so short, it's hardly taking up space.
I agree with the support for it being opt-out.
Another possible solution, what if it had the attribution message if the url refers to your vercel instance?
And then either have it not displayed on seperate forked instances or have it be opt-out/opt-in.
This would both better attribute the work going on here and decrease the load on your instance.
I tend to agree with opt-out behavior here - Found this project being used for somebody else's profile, yet had to clone their repo and open README.md to figure out what they were using - unnecessarily hard.
URL parameters sound like the best thing to do here - make it easy to give credit (given by default), and easy to hide the credit if you prefer to do it your own way (hide_credits=true). Forcing me to star a repository to disable it is just... wrong.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I think it is a nice thing when you can disable it, if we disclose that, I think it is a nice addition. It isn't much disruptive, I like it. @anuraghazra