Track number of download of a release (binaries) on Github

前端 未结 3 2040
别跟我提以往
别跟我提以往 2021-02-07 08:56

So now you can manage and publish your binaries directly on Github, the feature is back from early this month (source).

I\'ve been looking around Github interface and I

3条回答
  •  故里飘歌
    2021-02-07 10:02

    Based on Petros answer, I used the two following curl command:

    To get the list of all releases including their id and number of download:

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

    For example to list all the release for the OpenRefine project:

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

    Then to get details on each release (you will need to run the first query to get the release id)

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

    With the same example to list the details including download number for 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"
    

提交回复
热议问题