Gather data on which Github repos you starred.
for i in {1..20}
do
curl -H "Accept: application/vnd.github.v3.star+json" "https://api.github.com/users/tphummel/starred?page=$i" > "p$i.json"
done
cat *.json | jq --slurp '. | flatten | .[] | select((.starred_at >= "2016-01-01") and (.starred_at <= "2016-12-31"))' | jq --slurp '.' > 2016-github-stars.json
how many total repos did i star in 2016?
cat *.json \
| jq --slurp '. | flatten | .[] | select((.starred_at >= "2016-01-01") and (.starred_at <= "2016-12-31"))' \
| jq --slurp 'length'
210
which languages did I star most frequently in 2016?
cat *.json \
| jq --slurp '. | flatten | .[] | select((.starred_at >= "2016-01-01") and (.starred_at <= "2016-12-31"))' \
| jq --slurp '.[] .repo.language' \
| awk '{ FS="\n" count[$1]++}END{for(j in count) print j","count[j]}' \
| sort -t "," -k2 -nr
"JavaScript",63
"Python",34
"Go",34
"Shell",20
"Ruby",13
null,12
"C",7
"Java",5
"HCL",4
"PHP",3
"Objective-C",3
"HTML",3
"Perl",2
"CSS",2
"TeX",1
"Roff",1
"Jupyter Notebook",1
"Hack",1
"C++",1
🛠by Tom Hummel