GithubAPI:如何使用给定语言编写所有存储库
我能够用的v2以JSON格式用给定的语言标记所有github存储库,但这个版本是去年的。我找不到任何方法来处理这个问题 有什么想法吗?如果我跑步: 卷曲https://api.github.com/legacy/repos/search/Go?language=GoGithubAPI:如何使用给定语言编写所有存储库,github,Github,我能够用的v2以JSON格式用给定的语言标记所有github存储库,但这个版本是去年的。我找不到任何方法来处理这个问题 有什么想法吗?如果我跑步: 卷曲https://api.github.com/legacy/repos/search/Go?language=Go { "repositories": [ { "type": "repo", "username": "mattn", "name": "go-gtk", "owner":
{
"repositories": [
{
"type": "repo",
"username": "mattn",
"name": "go-gtk",
"owner": "mattn",
"homepage": "http://mattn.github.com/go-gtk",
"description": "Go binding for GTK",
"language": "Go",
"watchers": 342,
"followers": 342,
"forks": 67,
"size": 416,
"open_issues": 34,
"score": 54.450714,
"has_downloads": true,
"has_issues": true,
"has_wiki": true,
"fork": false,
"private": false,
"url": "https://github.com/mattn/go-gtk",
"created": "2009-11-26T16:58:53Z",
"created_at": "2009-11-26T16:58:53Z",
"pushed_at": "2013-09-02T04:29:39Z",
"pushed": "2013-09-02T04:29:39Z"
}
]
}
<TRIMMED>
但是在请求中使用-H
媒体类型,您将得到正确的响应
在Windows上:
c:\prgs\git\PortableGit-1.8.3-preview20130601\bin\curl.exe -H "Accept: application/vnd.github.preview.text-match+json" https://api.github.com/search/repositories?q=language:go&order=desc
(请注意标题周围的
“
而不是”
接受)尚未尝试(因此评论),但似乎有一个语言参数可以输入其中…这可能是可以利用的,还是需要一个关键字?@Charlie。谢谢,我忽略了这一点。但如果我正确理解了文档,似乎应该可以这样做:https://api.github.com/legacy/repos/search/Go?language=Go
,但这并不影响你在页眉中发送application/vnd.github.preview
,只返回top 99,可以分页
c:\prgs\git\PortableGit-1.8.3-preview20130601\bin\curl.exe -H "Accept: application/vnd.github.preview.text-match+json" https://api.github.com/search/repositories?q=language:go&order=desc