Skip to content

Instantly share code, notes, and snippets.

@sebasjm
Created July 8, 2018 17:23
Show Gist options
  • Save sebasjm/df3bdeab9c818fe615adcc7c8de8ba96 to your computer and use it in GitHub Desktop.
Save sebasjm/df3bdeab9c818fe615adcc7c8de8ba96 to your computer and use it in GitHub Desktop.
Importar todos los repositorios de GitHub en un Excel
curl -u "user" "https://api.github.com/orgs/company/repos?per_page=100" | tee result.json
curl -u "user" "https://api.github.com/orgs/company/repos?per_page=100&page=2" | tee result2.json
cat result.json result2.json | jq -s add > all.json
cat all.json | jq '.[]|{"name":.name, "private":.private, "html_url": .html_url, "description": .description, "created_at": .created_at, "updated_at": .updated_at, "pushed_at": .pushed_at, "homepage": .homepage, "stargazers_count": .stargazers_count, "watchers_count": .watchers_count, "language": .language, "archived": .archived, "forks": .forks, "open_issues": .open_issues, "watchers": .watchers}' > filtrado.json
cat filtrado.json | jq -s . | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > filtrado.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment