gpt4 book ai didi

Github:我可以查看存储库的下载数量吗?

转载 作者:行者123 更新时间:2023-12-03 04:32:31 24 4
gpt4 key购买 nike

在 Github 中,有没有办法可以查看存储库的下载数量?

最佳答案

2019 年更新:

Ustinanswer指向:

<小时/>

2017年更新

您仍然可以使用GitHub APIget the download count for your releases (这不完全所要求的)
请参阅“Get a single release”,download_count 字段。

不再有流量屏幕提及存储库克隆的数量。
相反,您必须依赖第三方服务,例如:

Git 2.14.2 release

<小时/>

2014 年 8 月更新

GitHub 还在其流量图中提出了存储库的克隆数量:
请参阅“Clone Graphs

/image/uycEZ.png

<小时/>

2013 年 10 月更新

如上所述below通过 andyberry88 ,正如我 detailed last July ,现在 GitHub proposes releases (参见its API),其中has a download_count field .

Michele Milidoni ,在 his (upvoted) answer ,确实在 his python script 中使用该字段.
(very small extract)

c.setopt(c.URL, 'https://api.github.com/repos/' + full_name + '/releases')
for p in myobj:
if "assets" in p:
for asset in p['assets']:
print (asset['name'] + ": " + str(asset['download_count']) +
" downloads")
<小时/>

原始答案(2010 年 12 月)

我不确定您是否可以看到该信息(如果它被记录的话),因为我在 GitHub Repository API 中没有看到它。 :

$ curl http://github.com/api/v2/yaml/repos/show/schacon/grit
---
repository:
:name: grit
:owner: schacon
:source: mojombo/grit # The original repo at top of the pyramid
:parent: defunkt/grit # This repo's direct parent
:description: Grit is a Ruby library for extracting information from a
git repository in an object oriented manner - this fork tries to
intergrate as much pure-ruby functionality as possible
:forks: 4
:watchers: 67
:private: false
:url: http://github.com/schacon/grit
:fork: true
:homepage: http://grit.rubyforge.org/
:has_wiki: true
:has_issues: false
:has_downloads: true

您只能查看它是否有下载。

<小时/>

Adam Jagosz报告in the comments :

I got it to work with

 curl -H "Accept: application/vnd.github.v3+json"   https://api.github.com/repos/:user/:repo/releases

A couple of things that I had wrong:

  • I needed an actual Github release (not just git tag, even though Github does display those under releases, ugh).
  • And the release needs an asset file other than the zipped source that is added automatically in order to get the download count.

关于Github:我可以查看存储库的下载数量吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4338358/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com