1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-27 01:09:49 +00:00

Add script to save data from GitHub issues, pull requests, and comments.

This commit is contained in:
Lars Brinkhoff
2017-01-24 11:00:00 +01:00
committed by Eric Swenson
parent 0d9e47296c
commit 6ee0e22590

22
build/github-data.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
get_next() {
grep Link: log | tr , '\n' | grep 'rel="next"' | sed 's/.*<\(.*\)>.*/\1/'
}
get_data() {
file=$1
url="https://api.github.com/$2"
n=1
while test -n "$url"; do
wget -S -o log -O "$file$n" "$url"
url=`get_next`
echo "NEXT: >>>$url<<<"
n=`expr $n + 1`
done
}
repo="PDP-10/its"
get_data issues "repos/$repo/issues?state=all&per_page=100"
get_data pulls "repos/$repo/pulls?state=all&per_page=100"
get_data comments "repos/$repo/issues/comments?per_page=100"