在「Get a single release」中提到的API是:
GET /repos/:owner/:repo/releases/:id
至於評論,您需要申請它反對回購的版本。
作爲一個例子,這裏是一個python gist(由Philip Hansen - Hanse00
)提取download_count
。
(未在R,但展現/repos/:owner/:repo/releases/:id
網址如何使用)
提取物:
#Iterate through every tag
search_point = 0
while formatted_string.find("tag_name", search_point) != -1:
#Find where in the string the tag and download texts are
find_point = formatted_string.find("tag_name", search_point)
download_point = formatted_string.find("download_count", find_point)
下面是一個even shorter script通過Brad Chapmanchapmanb
,使用sigmavirus24/github3.py
(Python庫用於與GitHub的APIv3接口):
#!/usr/bin/env python
"""Get download stats for releases from GitHub.
Needs development version of github3.
pip install github3
pip install git+https://github.com/sigmavirus24/github3.py.git
"""
import github3
repo = github3.repository("chapmanb", "bcbio.variation")
for release in repo.iter_releases():
for asset in release.iter_assets():
print release.name, asset.name, asset.download_count
(你有manymoreexamples)
@MichaelChirico我編輯了我的問題。 – Hahnemann
這個問題可以以某種方式增加投票嗎? – Hahnemann
你可以開始賞金獲得更多關注 – MichaelChirico