Last active
November 20, 2022 17:33
-
-
Save kokoichi206/5618a2f4927a189ebef9e95795d5b9f3 to your computer and use it in GitHub Desktop.
今日コード何行書いた?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1週間分の変更履歴 | |
## List repositories for the authenticated user | |
## https://docs.github.com/ja/rest/repos/repos#list-repositories-for-the-authenticated-user | |
## Get the weekly commit activity | |
## https://docs.github.com/ja/rest/metrics/statistics#get-the-weekly-commit-activity | |
curl -s \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token $REPO_TOKEN"\ | |
"https://api.github.com/users/$USER_NAME/repos?per_page=100" |\ | |
jq '.[].name' |\ | |
xargs -I@ curl -s \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token $REPO_TOKEN" \ | |
"https://api.github.com/repos/$USER_NAME/@/stats/code_frequency" |\ | |
jq '.[-1][]' | paste - - - | awk '{print $2+$3}' |\ | |
awk '{a += $0} END {print a}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
後半の、各々のリポジトリからコミットを求めるところについて。
以下の
git log
を使った方が正確。メリット
initial commit
,first commit
)