想用 github 来实现一个简单的记录心情或者事件的博客, 每个 commit 就会在生成一个状态,包含时间和内如,就像 github 的 release 列表一样。 但是如何读取提交记录呢?没有找到 json 文件什么的, 有知道告知一下;
另外,有一个 nodejs 实现的类似的项目, https://byronhsu.github.io/life-commit/,大家可以看看
想用 github 来实现一个简单的记录心情或者事件的博客, 每个 commit 就会在生成一个状态,包含时间和内如,就像 github 的 release 列表一样。 但是如何读取提交记录呢?没有找到 json 文件什么的, 有知道告知一下;
另外,有一个 nodejs 实现的类似的项目, https://byronhsu.github.io/life-commit/,大家可以看看
|
jasonsuiJun 27, 2019 via Android
1
webhook
|
|
RitterJun 27, 2019
2
插眼等大佬解答
|
|
3
花里胡哨。。。
|
|
SankoJun 27, 2019 via Android
4
commit 有长度限制吗
|
|
xapluxJun 27, 2019
5
感觉可以用 github 的 api 接口实现,developer.github.com/v3/repos/commits/
|
|
yuankuiJun 27, 2019
6
http://qinghua.github.io/jgit/
如果是 java 语言的话,可以用这个库,可以直接读取.git 仓库。包含所有你需要的元数据信息。 如果是其他语言的话,可以在这里找找: https://git-scm.com/book/uz/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-Libgit2 |
|
yuankuiJun 27, 2019
7
最后的最后,可以寄出大杀器:爬虫。
|
|
KuroNekoFanJun 27, 2019
8
git webhook
|
|
KuroNekoFanJun 27, 2019
9
跟 commit 自动触发 ci/cd 一个道理
|
|
NorthxwJun 27, 2019
10
爬虫
|
|
moodasmoodJun 27, 2019
11
花里胡哨+1
|
|
12
|
|
KuroNekoFanJun 27, 2019
13
@andyhuai 方法应该不限于一种,就我知道的,git cmd tool,比如
``` git ls-remote --tags ${repoURI} ``` 可以拿到这个 repoURI 对应的 tag 信息 |
|
14
commit 之前仓库要有改动才行,虽然也很容易实现,我还是想跟风说一个。。。花里胡哨+2
|
|
deepdarkJun 27, 2019 via Android
15
可以修改覆写.git 目录里的 hooks 文件夹里的内容,你的需求需要修改 post-commit,具体流程就是在你仓库 commit 的时候 bash 脚本拿到 commit msg 然后做你想要的操作,生成 markdown 发布博客或者是调用 web 接口都可以
|
|
jingyulongJun 27, 2019
16
官方接口可以做到啊。。。。。啥数据都有,https://developer.github.com/v4/guides/intro-to-graphql/
|
|
JiYouMCCJun 28, 2019
19
github api graphql
|
|
JiYouMCCJun 28, 2019
20
不一定要 comment,还可以起个 issue,然后用 issue 的帖子内容生成,这样就还能支持修改删除啥的
|