Skip to content

Instantly share code, notes, and snippets.

@jonmountjoy
Created September 25, 2012 14:18
Show Gist options
  • Save jonmountjoy/3782201 to your computer and use it in GitHub Desktop.
Save jonmountjoy/3782201 to your computer and use it in GitHub Desktop.
fetch my gists
# first you need to do a one-time setup step to create an OAuth token:
# do this to create an app with your OAUTH token
#
# curl -u github-user-name:github-password -H "Content-Type: application/json" -X POST -d '{"scopes":["gist"], "note": "gist backup"}' \
# https://api.github.com/authorizations
#
# export GIST_OAUTH_TOKEN=xxxxx <<- token retrieved from the curl
#
curl -H "Authorization: token `echo $GIST_OAUTH_TOKEN`" -H "Content-Type: application/json" -X GET https://api.github.com/gists | \
perl -ne 'if (m/.*raw.*(https.*)".*/){ print "$1\n"; }' | \
xargs -L 1 curl -OL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment