-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-commands.txt
11 lines (6 loc) · 1.59 KB
/
github-commands.txt
1
2
3
4
5
6
7
8
9
10
11
for x in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97; do curl "https://api.github.com/repos/cms-sw/cmssw/forks?page=$x" -u 'USERNAME:PASSWORD' > github-cmssw/forks-$x.json; echo $x; done
python -c 'import json, glob; print("\n".join([fork["owner"]["login"] for filename in glob.glob("github-cmssw/forks-*.json") for fork in json.load(open(filename))]))' > github-cmssw/users.txt
for x in `cat github-cmssw/users.txt`; do curl "https://api.github.com/users/$x/repos?per_page=100" -u 'USERNAME:PASSWORD' > github-cmssw/user-$x.json; echo $x; done
python -c 'import json, glob; print("repo,owner,isfork,created,language"); print("\n".join([",".join(map(str, [repo["name"], repo["owner"]["login"], repo["fork"], repo["created_at"], repr(repo["language"])])) for filename in glob.glob("github-cmssw/user-*.json") for repo in json.load(open(filename))]))' > github-cmssw.csv
curl "https://api.github.com/repos/scikit-hep/REPOSITORY/issues?state=all&page=PAGENUM&per_page=100" >> github-issues-REPOSITORY.json
python -c 'import json; print("number,title,user,state,date_created,date_closed,numcomments,ispull"); print("\n".join([",".join([str(x["number"]), json.dumps(x["title"]), x["user"]["login"], x["state"], str(x["created_at"]), str(x["closed_at"]), str(x["comments"]), str("pull_request" in x)]) for x in json.load(open("github-issues-REPOSITORY.json"))]))' > github-issues-REPOSITORY.csv