所以现在您可以直接在 Github 上管理和发布您的二进制文件,该功能从本月初(来源)恢复。
我一直在查看 Github 界面,但没有看到下载跟踪器。这是 Google Code 提供的一项功能,我想知道 Github 是否有相同的功能。
请注意,我不想知道回购的下载次数,这是一个不同的话题。
根据 Petros 的回答,我使用了以下两个 curl 命令:
要获取所有版本的列表,包括它们的 id 和下载次数:
curl -i https://api.github.com/repos/:owner/:repo/releases -H "Accept: application/vnd.github.manifold-preview+json"
例如列出 OpenRefine 项目的所有版本:
curl -i https://api.github.com/repos/openrefine/openrefine/releases -H "Accept: application/vnd.github.manifold-preview+json"
然后获取每个版本的详细信息(您需要运行第一个查询以获取版本 ID)
curl -i https://api.github.com/repos/:owner/:repo/releases/assets/:release_id -H "Accept: application/vnd.github.manifold-preview+json"
以相同的示例列出详细信息,包括下载编号google-refine-2.5-r2407.zip
curl -i https://api.github.com/repos/openrefine/openrefine/releases/assets/6513 -H "Accept: application/vnd.github.manifold-preview+json"
您可以使用 GitHub API 获取download_count
单个发布资产的其他内容:
http://developer.github.com/v3/repos/releases/#get-a-single-release-asset
这就是它目前的样子,但请检查上面的链接,以防万一在编写此答案后发生任何变化。
GET /repos/:owner/:repo/releases/assets/:id
{
"url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
"id": 1,
"name": "example.zip",
"label": "short description",
"state": "uploaded",
"content_type": "application/zip",
"size": 1024,
"download_count": 42,
"created_at": "2013-02-27T19:35:32Z",
"updated_at": "2013-02-27T19:35:32Z"
}
您可以将徽章添加到您的 github 存储库。有关更多详细信息,请参阅此答案。
此外,还有一个漂亮的项目可以在一个不错的网站上显示所有这些数据:https ://www.somsubhra.com/github-release-stats/