9

我试图了解 GitHub 上 100 个最大存储库的演变。使用 GitHub 搜索功能或 GithubArchive.org,我可以轻松访问截至目前的 100 个最大的存储库(以贡献者、star、fork 或 LOC 的总数衡量)。

但是,我想查看历史上给定数据(例如 2011 年 4 月 1 日)中最大的 100 个存储库,以便从那时起跟踪它们的增长(或下降)。如何确定过去某个日期 GitHub 上最大的 100 个存储库(按星、叉或 LOC 衡量)?

4

1 回答 1

10

我认为 GitHub 存档项目可以提供帮助:http ://www.githubarchive.org/

它存储来自 GitHub 时间线的所有公共事件并公开它们以供处理。这些事件包含有关存储库的信息,因此您应该能够从那里提取数据以适合您的用例。

例如,我刚刚在 BigQuery 控制台 ( https://bigquery.cloud.google.com/?pli=1 ) 中使用了以下查询来找出 2012 年的 joyent/node 存储库的分支数-03-15:

SELECT repository_forks, created_at FROM [publicdata:samples.github_timeline] WHERE (repository_url = "https://github.com/joyent/node") AND (created_at CONTAINS "2012-03-15") LIMIT 1

结果如下:

Row forks   created_at   
1   1579    2012-03-15 07:49:54  

显然,您会使用 BigQuery API 来执行类似的操作(提取您想要的数据、获取一系列日期的数据等)。

这是一个查询,用于获取给定日期的单个最大存储库(通过分叉):

SELECT repository_forks, repository_url FROM [publicdata:samples.github_timeline] WHERE (created_at CONTAINS "2012-03-15") ORDER BY repository_forks DESC LIMIT 1

结果:

Row forks   repository_url   
1   6341    https://github.com/octocat/Spoon-Knife   

以下是通过 fork 获取给定日期前 100 个存储库的查询:

SELECT MAX(repository_forks) as forks, repository_url FROM [publicdata:samples.github_timeline] WHERE (created_at CONTAINS "2012-03-15") GROUP BY repository_url ORDER BY forks DESC LIMIT 100

结果:

Row forks   repository_url   
1   6341    https://github.com/octocat/Spoon-Knife   
2   4452    https://github.com/twitter/bootstrap     
3   3647    https://github.com/mxcl/homebrew     
4   2888    https://github.com/rails/rails
...
于 2012-12-06T18:38:48.543 回答