gh-notify-move/get-my-repos.sh

10 lines
285 B
Bash
Raw Permalink Normal View History

2018-06-06 14:04:33 +00:00
#!/bin/bash
GHUSER="${1:-$USER}"
NBPAGES="${2:-1}"
for page in $(seq 1 $NBPAGES); do
echo "Retrieving page $page" >&2
curl "https://api.github.com/users/$GHUSER/repos?page=${page}&per_page=100" | grep '"ssh_url":' | perl -pe 's#^\s*"ssh_url": "([^"]*)".*$#$1#'
done > repos-urls