Skip to content

Instantly share code, notes, and snippets.

@marianogappa
Last active February 12, 2017 01:55
Show Gist options
  • Save marianogappa/4ea4164608325faef7042ece4ae348ee to your computer and use it in GitHub Desktop.
Save marianogappa/4ea4164608325faef7042ece4ae348ee to your computer and use it in GitHub Desktop.
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