Skip to content

Instantly share code, notes, and snippets.

@atrakic
Last active July 7, 2018 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atrakic/e5138717d9934926dbc8e92d4e8bf0a4 to your computer and use it in GitHub Desktop.
Save atrakic/e5138717d9934926dbc8e92d4e8bf0a4 to your computer and use it in GitHub Desktop.
#!/bin/bash
USER=${1:-atrakic}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
PER_PAGE=10
PAGES=$((658/$PER_PAGE+1))
for PAGE in `seq $PAGES`; do
curl -s "https://api.github.com/users/$USER/starred?per_page=$PER_PAGE&page=$PAGE" | jq -r '.[] | (.html_url) + " " + (.full_name)' | xargs -L1 -P4 git clone
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment