这一切都要从一直蝙蝠说起~ XD
因为自己在 GitHub 上有些项目,但是 stars 都不是很多,一两百两三百的,看上去很没有逼格(划去)
于是想找个办法统计一下自己总共拿了多少 stars,展示出来方便装逼(划去)
但是翻了翻 GitHub 的 API 并没有看到能直接拿到总数的方法,于是自己写了个
已经部署在 Heroku 上了,路由是 user/:username
比方说想看我的就是这样 https://github-star-counter.herokuapp.com/user/idealclover
有了这个 API 之后就可以配合 shields.io 做一点更酷的事情
比如说把总 stars 和 forks 以徽章的方式呈现出来
但是因为担心网络超时和 V2EX 的缓存,提供了静态预览,像这样啦
这样挂在 blog 上还是有点逼格的(不是
欢迎来试试!
GitHub 地址: https://github.com/idealclover/GitHub-Star-Counter
我的博客: https://idealclover.top/
新手发帖有点小紧张~(逃
![]() | 2 idealclover OP @RYAN0UP 哇!!太强了吧嘤嘤嘤 |
![]() | 3 TristanYang 2020-02-23 00:44:27 +08:00 想起了之前写的一个统计仓库每日新增 star 的小工具: https://stars.yangerxiao.com/ |
4 manami 2020-02-23 07:23:11 +08:00 via Android 不错 |
![]() | 5 llussy 2020-02-23 08:43:34 +08:00 via iPhone 赞赞赞 |
![]() | 6 idealclover OP @TristanYang 哇这个好棒! www 赞!~ 那说不定可以合起来做一个统计总 star 增长的工具? |
![]() | 7 xcodebuild 2020-02-23 20:57:29 +08:00 挺有意思的 API |
![]() | 8 idealclover OP |
![]() | 9 justin2018 2020-02-24 10:03:24 +08:00 |
![]() | 10 justin2018 2020-02-24 10:05:07 +08:00 已 star |
![]() | 11 TristanYang 2020-02-24 13:31:17 +08:00 @idealclover 哈哈 你那个可以通过 url 传参的方式,链接到我这里,目前已支持: https://stars.yangerxiao.com/?repo=https://github.com/zerosoul/chinese-colors |
![]() | 12 idealclover OP @justin2018 哇! ww 这个好 我也好想有一天可以上榜哇(哭 |
![]() | 13 idealclover OP @TristanYang 好!我回头试试! |
![]() | 14 hzlzh PRO ![]() |
![]() | 15 hzlzh PRO @TristanYang https://stars.yangerxiao.com/?repo=https://github.com/hzlzh/Best-App 我这个库每次跑到 2019 年页面就会死掉? |
![]() | 16 TristanYang 2020-02-26 13:12:19 +08:00 @hzlzh 死掉是白页吗?我试了下 并没有 可能是 2019 年数据略多吧 需要点时间加载。 |
![]() | 17 idealclover OP 好强啊!羡慕~ |
![]() | 18 idealclover OP @hzlzh 好强啊!羡慕~ |
19 fengkx 2020-03-17 00:39:12 +08:00 做了一个跑在 Cloudflare worker 上的版本。[https://github.com/fengkx/github-star-counter-cloudflare-worker]( https://github.com/fengkx/github-star-counter-cloudflare-worker) 完全一样的逻辑。 每天 10w 次免费请求。https://api.github-start-counter.workers.dev/ 一切原自一个美丽的误会。原来 Cloudflare worker 注册时选的域名是 account 级的,我以为像 netlify 那样一个网站( worker )一个二级域名。而且还不能改。。。 这个 account 就献祭掉了~ |
![]() | 20 idealclover OP @fengkx 呜呜呜呜呜呜我想着毕业论文写完之后做一个 cloudflare worker 版本的来的嘤嘤嘤 |