Skip to content

Instantly share code, notes, and snippets.

@marianogappa
Last active Feb 12, 2017
Embed
What would you like to do?
Ranking of GH repos per stargazers on your organisation
# (requires jq)
# USER=your_github_username
# ACCESS_TOKEN=your_github_access_token
# ORGANIZATION=your_organization
curl -u $USER:$ACCESS_TOKEN -s "https://api.github.com/orgs/$ORGANIZATION/members?per_page=100" | \
jq -r '.[] | "\(.repos_url)?per_page=100"' | \
while read line; do echo -n "$(curl -s $line | jq --raw-output '.[] | {a:.stargazers_count,b:.full_name} | .[] ' | paste -s -d ' \n' - )"; done | \
sort -rn | grep -v '^0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment