Github: Can I see the number of downloads for a repo?

后端 未结 17 1092
甜味超标
甜味超标 2020-11-28 02:35

In Github, is there a way I can see the number of downloads for a repo?

17条回答
  •  日久生厌
    2020-11-28 03:19

    GitHub has deprecated the download support and now supports 'Releases' - https://github.com/blog/1547-release-your-software. To create a release either use the GitHub UI or create an annotated tag (http:// git-scm.com/book/ch2-6.html) and add release notes to it in GitHub. You can then upload binaries, or 'assets', to each release.

    Once you have some releases, the GitHub API supports getting information about them, and their assets.

    curl -i \
    https://api.github.com/repos/:owner/:repo/releases \
    -H "Accept: application/vnd.github.manifold-preview+json"
    

    Look for the 'download_count' entry. Theres more info at http://developer.github.com/v3/repos/releases/. This part of the API is still in the preview period ATM so it may change.

    Update Nov 2013:

    GitHub's releases API is now out of the preview period so the 'Accept' header is no longer needed - http://developer.github.com/changes/2013-11-04-releases-api-is-official/

    It won't do any harm to continue to add the 'Accept' header though.

提交回复
热议问题