【问题标题】:How do I get all public GitHub repo that are PHP using GitHub API?如何使用 GitHub API 获取所有 PHP 的公共 GitHub 存储库?
【发布时间】:2013-12-11 16:45:29
【问题描述】:

我发现这个链接向我展示了如何使用 GitHub API 获取所有存储库。

http://developer.github.com/v3/repos/#list-all-repositories

但我不确定如何找到所有 PHP 存储库。

例如这给了我们一个选择的快照。 https://github.com/trending?l=php

如果这是我可以找到的存储库数量的限制,我更愿意获得至少 500 个拥有最多观星者的 PHP 存储库。

之后,我想获取每个存储库的观星者和贡献者的列表。

如何使用 GitHub API 完成此操作?

我正在研究这些存储库的网络效应,所以我需要上述原始数据。

【问题讨论】:

  • 别忘了标记伊万的答案。 :)

标签: php github github-api


【解决方案1】:

您可以使用搜索。以下是在 github.com 上使用搜索的方法(使用 Advanced Search form):

https://github.com/search?l=PHP&o=desc&q=stars%3A%3E%3D0&s=stars&type=Repositories

这是等效的 API(使用 Search API):

https://api.github.com/search/repositories?q=language:php&sort=stars

但是,请注意 Search API returns only the top 1000 results and the total count.您可以通过基于 time that the repositories were created 将搜索 API 查询分成多个调用来绕过该限制。

获取所有仓库后,您可以使用Starring API 获取stargazers 列表,使用Contributors API 获取贡献者列表。

另外,您可能对(非官方)GitHub Archive project 感兴趣,它跟踪、保存和公开来自公共 GitHub 时间线的事件。

【讨论】:

    猜你喜欢
    • 2019-11-17
    • 1970-01-01
    • 2016-12-14
    • 2017-03-28
    • 2017-07-29
    • 2019-07-12
    • 2017-09-01
    • 2014-09-29
    • 2021-08-29
    相关资源
    最近更新 更多