-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
[feature request]: Get contributors data from Github API #11
Comments
hey @ashutoshkrris. I would like to work on this issue |
Sure @Tawishi , go ahead! |
I am able to fetch the contributors, excluding the bot, using the Github API |
you can create a file called |
@ashutoshkrris what data is needed out of this? "author": {
"login": "ashutoshkrris",
"id": 47353498,
"node_id": "MDQ6VXNlcjQ3MzUzNDk4",
"avatar_url": "https://avatars.githubusercontent.com/u/47353498?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ashutoshkrris",
"html_url": "https://github.com/ashutoshkrris",
"followers_url": "https://api.github.com/users/ashutoshkrris/followers",
"following_url": "https://api.github.com/users/ashutoshkrris/following{/other_user}",
"gists_url": "https://api.github.com/users/ashutoshkrris/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ashutoshkrris/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ashutoshkrris/subscriptions",
"organizations_url": "https://api.github.com/users/ashutoshkrris/orgs",
"repos_url": "https://api.github.com/users/ashutoshkrris/repos",
"events_url": "https://api.github.com/users/ashutoshkrris/events{/privacy}",
"received_events_url": "https://api.github.com/users/ashutoshkrris/received_events",
"type": "User",
"site_admin": false
} |
From this API, the |
ok, so getting the |
This API might be useful : |
this works @ashutoshkrris
|
We're making use of GITHUB API TOKENS in the headers, right? |
almost forgot that. working on it |
i got the answer in the docs that is why I removed the comment @ashutoshkrris |
we will use whose personal token here? |
You can create one for yourself and try with that. |
what should the data be returned as, any specific return type of the required contributor information like JSON, etc.? |
you can just return a python dictionary from your function or method. |
ok |
you can return like this : result = {
"username": username,
"name": name,
"profile_url": html_url
}
return result |
we have a list of contributors, so a list of such dictionaries? or how do you suggest I represent multiple contributors? |
Oops, forgot that. contributors = [
{
"name": "Contributor 1",
"username": "contri1",
"profile_url": "https://github.com/contri1/"
},
{
"name": "Contributor 2",
"username": "contri2",
"profile_url": "https://github.com/contri2/"
}
]
return contributors |
all done. I will create a PR |
does this need any documentation update? |
Nope, I don't think so as the user need not perform any extra step for getting added as contributors |
@ashutoshkrris checks are failing. Could you please check if any changes are needed from my end? |
There were some minor bugs in the workflows. |
Thank you @ashutoshkrris for your sypport and patience |
Thanks for contributing @Tawishi |
Is there an existing issue for this?
Describe the feature.
As we are building a contributors page, we need data of contributors.
Problem/Motivation.
As people are gradually contributing to the project, we must be thankful for their efforts.
Possible Solution/Pitch.
There are two approaches :
contributors.json
and then using Javascript, we can make use of that data.Anything else?
Since some bots such as
dependabots
can be found in the contributors' list. So, while using Github API, make sure you exclude them.Code of Conduct
The text was updated successfully, but these errors were encountered: