Skip to content

Instantly share code, notes, and snippets.

@ake-persson
Last active March 6, 2020 15:47
Show Gist options
  • Save ake-persson/f1313b9209ea7c2e66be5141a8b8f974 to your computer and use it in GitHub Desktop.
Save ake-persson/f1313b9209ea7c2e66be5141a8b8f974 to your computer and use it in GitHub Desktop.
Get Org. GitHub users
#/bin/bash
URL="https://api.github.com"
AUTH="Authorization: token $(cat ~/.ghtoken)"
curl -s -H "${AUTH}" "${URL}/orgs/IndependentIP/members?page=1&per_page=1000" >users.json
echo "login,site_admin,name,email"
for u in $(jq -r '.[] | "\(.login),\(.site_admin),\(.url)"' users.json); do
curl -s -H "$AUTH" "${u##*,}" | jq -r ". | \"${u%,*},\(.name),\(.email)\""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment