sni*_*im2 5 json curl github github-api
根据v3文档我会想到这个:
$ curl https://api.github.com/legacy/repos/search/python?language=Python&sort=forks&order=desc
Run Code Online (Sandbox Code Playgroud)
将按照分叉数的降序返回前100个Python存储库.它实际上返回一个空(json)存储库列表.
这个:
$ curl https://api.github.com/legacy/repos/search/python?language=Python&sort=forks
Run Code Online (Sandbox Code Playgroud)
返回存储库列表(在json中),但其中许多未列为Python存储库.
所以,显然我误解了Github API.检索特定语言的前N个存储库的可接受方法是什么?
正如 pengwynn 所说,目前仅通过 GitHub 的 API 很难做到这一点。但是,请查看使用 GitHub Archive 项目进行查询的另一种方法:如何查找过去日期的 100 个最大的 GitHub 存储库?
本质上,您可以使用类似 SQL 的语言来查询 GitHub 的历史数据。因此,如果实时结果对您来说并不重要,您可以在https://bigquery.cloud.google.com/?pli=1上执行以下查询来获取截至 4 月份的前 100 个 Python 存储库2013 年 1 日(昨天),按分叉数量递减:
SELECT MAX(repository_forks) as forks, repository_url
FROM [githubarchive:github.timeline]
WHERE (created_at CONTAINS "2013-04-01" and repository_language = "Python")
GROUP BY repository_url
ORDER BY forks
DESC LIMIT 100
Run Code Online (Sandbox Code Playgroud)
我已将查询结果以 CSV 格式放入此 Gist中,前几个存储库是:
forks repository_url
1913 https://github.com/django/django
1100 https://github.com/facebook/tornado
994 https://github.com/mitsuhiko/flask
...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1108 次 |
最近记录: |