如何列出所有GitHub用户? [英] How to list all GitHub users?

查看:185
本文介绍了如何列出所有GitHub用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个网站上工作,需要从GitHub抓取所有用户信息(至少是我们网站上的用户)。我搜索了GitHub API,但没有找到答案。



那么有什么方法可以完成这项工作吗?
我只有用户的电子邮件。 (我可以通过比较电子邮件哈希与gravatar URL来检查用户)


  1. 我已经发送电子邮件给GitHub支持,但目前没有答案。

  2. 我只需要知道用户名,我就可以使用GitHub API获取其他信息。 >解决方案

正如这里所述,您可以依靠这两个以下API检索JSON格式的输出。根据要求,他们都提供gravatar URL。



合作者(项目组织成员)



搜索存储库(给定一些关键字(language,stack,...)检索存储库列表,使用两个第一个提议,列出他们的合作者和/或贡献者) / api / v2 / json / repos / search /:这里+去+你的+关键字[GET]

  • 例子: https://github.com/api/v2/json/repos / search / stackoverflow



  • 注意:确保API的预期用途在符合 GitHub服务条款


    I'm working on a site, need to crawl all user information (at least the user on our site) from GitHub. I searched GitHub API, and found no answer.

    So is there any way I can do this job? I only have the users emails. (I can check user by compare the email hash with gravatar URL)

    1. I had send email to GitHub support, and got no answer currently.
    2. I only need know the usernames, I can use GitHub API to get other informations.

    解决方案

    As described here you may rely on those two following APIs to retrieve a JSON formatted output. As requested, both of them provide the gravatar URL.

    Collaborators (members of the organization on the project)

    Contributors (authors of, at least, one commit)


    UPDATE:

    The previous API methods requires that you start from a known repository. The two following proposals try to work around this constraint. They rely on the previous version of the API (v2)

    Query by email (in your question, you state "I only have the users emails.". Provided the users agreed to publish them you should be able to retreive some information about the user using the email as a query parameter)

    Search for repositories (given some keywords (language, stack, ...) retrieve a list of repositories. Then, for each one, using the two first proposals, list their collaborators and/or contributors)

    Note: Make sure that intended usage of the API is in concordance with GitHub Terms of service

    这篇关于如何列出所有GitHub用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆