Skip to content

Instantly share code, notes, and snippets.

@marianogappa
Created May 22, 2016
Embed
What would you like to do?
Byte count per programming language on your github account
USER=my_github_username
ACCESS_TOKEN=my_github_access_token
curl -u $USER:$ACCESS_TOKEN -s "https://api.github.com/user/repos" | jq -r 'map(.languages_url) | .[]' | xargs curl -s -u $USER:$ACCESS_TOKEN | jq -r '. as $in| keys[] | [.+ " "]+[$in[.] | tostring] | add' | awk '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}' | awk '{print $2, $1}' | sort -nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment