-
Notifications
You must be signed in to change notification settings - Fork 64
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
Create meta endpoints #199
Comments
Maybe we could host all that under a |
@koddsson genius. Please come back to the same continent so I can give you a big hug |
@koddsson agree completely - first we ruled it out, but we were thinking |
So I updated the initial comment to reflect this |
I started something in the |
@koddsson expanded on that - experimenting with the maintainers endpoint though, was thinking instead of just returning this [
{
"login": "benediktvaldez",
"avatar_url": "https://avatars.githubusercontent.com/u/1928103?v=3",
"url": "https://api.github.com/users/benediktvaldez"
},
{
"login": "koddsson",
"avatar_url": "https://avatars.githubusercontent.com/u/318208?v=3",
"url": "https://api.github.com/users/koddsson"
}
] I'd like to get something like this (getting the data from the [
{
"user": "benediktvaldez",
"avatar": "https://avatars.githubusercontent.com/u/1928103?v=3",
"name": "",
"email": "",
"bio": ""
},
{
"user": "koddsson",
"avatar": "https://avatars.githubusercontent.com/u/318208?v=3",
"name": "",
"email": "",
"bio": ""
}
] But not sure how best to do that - was trying something like this ... endpoint.get('/maintainers/', function(req, res, fail) {
var options = {
url: 'https://api.github.com/orgs/apis-is/public_members',
headers: {
'User-Agent': 'apis-is'
}
};
request.get(options, function(err, response, body) {
if (err) return res.json({error: err});
var maintainers = _.map(JSON.parse(body), function(n) {
var user = {};
request.get({ url: n.url, headers: { 'user-agent': 'apis-is' } }, function(error, res, data) {
if (err) return;
user = JSON.parse(data);
});
var maintainer = {
'user': n.login,
'avatar': n.avatar_url
};
maintainer.name = user.name;
maintainer.email = user.email;
maintainer.hireable = user.hireable;
maintainer.bio = user.bio;
return maintainer;
});
return res.json(maintainers);
});
}); ... but the second request hasn't finished at I think my approach is wrong - thoughts? Also @MiniGod - you're clever, thoughts? 😄 |
Use |
I've got something working but got hit by the github api rate limit. Will pick it up tomorrow. |
Looks great @koddsson - looking forward to it 😺 |
Added |
Meta has been merged so I'm closing this. Create a new thread to work on updates |
So we want to create meta endpoints, partially mapped from the official github API, but to some extent manually entered info.
/meta/maintainers
> list of official maintainersfrom /orgs/apis-is/public_members (only maintainers should be public members of the org)
/meta/contributors
> list of all contributorsfrom /repos/apis-is/apis/contributors
/meta/sponsors
> list of sponsorsif sponsors have a github user/org than it would be hardcoded into the endpoint
/meta/about
> content that goes into the about section on the documentation page (hardcoded into endpoint)The text was updated successfully, but these errors were encountered: