Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion]: Showing attribution to the stats card #90

Closed
anuraghazra opened this issue Jul 17, 2020 · 63 comments
Closed

[Discussion]: Showing attribution to the stats card #90

anuraghazra opened this issue Jul 17, 2020 · 63 comments
Labels
stale Issue is marked as stale.

Comments

@anuraghazra
Copy link
Owner

Hi everyone,

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 :-

credit_grs

Now here's the nice part.

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

@filiptronicek
Copy link
Contributor

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

@jatin2003
Copy link

I really liked your Idea @anuraghazra 🧡

@garvit-joshi
Copy link

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.

@ApurvShah007
Copy link

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.

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 17, 2020

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.

@omidnikrah
Copy link
Contributor

I also agree and I think it's so good and helps other developers to use and find it easily.

@nombrekeff
Copy link
Contributor

I like the idea, and the card looks good with the credits. Not very disruptive

@Karthik-Nayak98
Copy link

It is a good idea

@Aju100
Copy link
Contributor

Aju100 commented Jul 18, 2020

i agree and it's a good idea

@mainrs
Copy link

mainrs commented Jul 18, 2020

I woudls sugges to show a shortened version. The username/reponame is long, maybe sometrhing like git.io/readme-stats

@anuraghazra
Copy link
Owner Author

@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

@mainrs
Copy link

mainrs commented Jul 18, 2020

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 :)

@anuraghazra anuraghazra pinned this issue Jul 19, 2020
@anuraghazra
Copy link
Owner Author

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

@garvit-joshi
Copy link

Approach looks nice, but the query will become extra long if there are more query attached to it.

@anuraghazra
Copy link
Owner Author

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 🤔 I'm all ears for more ideas tho, which does not effect performance :)

@mainrs
Copy link

mainrs commented Jul 20, 2020

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

@mainrs
Copy link

mainrs commented Jul 20, 2020

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.

@anuraghazra
Copy link
Owner Author

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.

@mainrs
Copy link

mainrs commented Jul 20, 2020

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.

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 20, 2020

@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

@mainrs
Copy link

mainrs commented Jul 20, 2020

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.

@anuraghazra
Copy link
Owner Author

Here

pagination_gh

And you have to set the pagination which is 100max

query { 
  repository(name:"github-readme-stats", owner: "anuraghazra") {
    stargazers(first: 100) {
      nodes {
        login
      }
    }
  }
}

@mainrs
Copy link

mainrs commented Jul 20, 2020

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.

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 20, 2020

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)

@jatin2003
Copy link

I agree with you @anuraghazra as It'll have a bad impact upon loading of the stats too.

@nombrekeff
Copy link
Contributor

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.

Some ideas I had:

If we add the option to hide it:

  • I would suggest just adding an option to hide it, at least they have to come to the repo and search for the option. Maybe we could even hide it inside this issue or something so they need to search for a while.

If we don't add the option to hide it:

  • You could set up a custom domain, for example: 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.

    • This can be hard as people already point to the actual domain.
  • We could show it always, but try to make the attribution less obstrusive, maybe with a link similar to what @sirwindfield said git.io/readme-stats. Or just something like: With ❤️ by @anuraghazra or even better By @anuraghazra

What do you guys think about this?

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 23, 2020

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 #90 (comment)

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"

@mainrs
Copy link

mainrs commented Jul 23, 2020

A little bit shorter:

⚡ by git.io/readme-stats

@mainrs
Copy link

mainrs commented Jul 23, 2020

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

@nombrekeff
Copy link
Contributor

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.

@mainrs
Copy link

mainrs commented Jul 23, 2020

That could be an alternative

@nombrekeff
Copy link
Contributor

Just throwing ideas.

@anuraghazra
Copy link
Owner Author

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

@nombrekeff
Copy link
Contributor

yeah, readme-stats is good for me too!

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 23, 2020

@nombrekeff @sirwindfield

grs-credit
grs-credit2
grs-credit3

@filiptronicek
Copy link
Contributor

I like it! Pretty nice @anuraghazra

@anuraghazra
Copy link
Owner Author

also @filiptronicek i'm going with simple undocumented ?hide_credits=true option

Any suggestions on the parameter name?

@mainrs
Copy link

mainrs commented Jul 23, 2020

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+... :(

@filiptronicek
Copy link
Contributor

also @filiptronicek i'm going with simple undocumented ?hide_credits=true option

Any 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

@anuraghazra
Copy link
Owner Author

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

@mainrs
Copy link

mainrs commented Jul 23, 2020

@anuraghazra Vote for config that allows to align it in the center:
mock

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

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 23, 2020

Maybe on the left side?
grs-credit-left

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

@mainrs
Copy link

mainrs commented Jul 23, 2020

I do think that the middle looks the best to be honest.

@anuraghazra
Copy link
Owner Author

Center:
center_credit

Corner:
grs-credit-corner

@mainrs
Copy link

mainrs commented Jul 23, 2020

Ye, I do like the center one more! :) Any plans on adding it to the other cards as well?

@creativecreatorormaybenot

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:

  1. 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.
  2. This is connected to the first point: it is simply not appealing and takes away from the magic. Right now, it might as well be part of GitHub.

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 😕

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 31, 2020

@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

@creativecreatorormaybenot

@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 👍🏽).

@anuraghazra
Copy link
Owner Author

anuraghazra commented Jul 31, 2020

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 ❤️
I think if your disagreement was followed by a proper solution as @nombrekeff did i would appreciate it more.


Now let's talk about solution instead of discussing what is right or wrong.

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.

@ApurvShah007
Copy link

@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

@adi-g15
Copy link

adi-g15 commented Aug 19, 2020

What is the url parameter to specify, to have the attribution ? I see many suggested throughout the issue, and have tried some.

@mainrs
Copy link

mainrs commented Aug 19, 2020

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.

@jmahlers
Copy link

jmahlers commented Sep 2, 2020

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.

@ecc521
Copy link

ecc521 commented Oct 29, 2020

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.

@stale
Copy link

stale bot commented Dec 6, 2020

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.

@stale stale bot added the stale Issue is marked as stale. label Dec 6, 2020
@stale stale bot closed this as completed Dec 13, 2020
@anuraghazra anuraghazra unpinned this issue Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is marked as stale.
Projects
None yet
Development

No branches or pull requests