Created
September 25, 2012 14:18
-
-
Save jonmountjoy/3782201 to your computer and use it in GitHub Desktop.
fetch my gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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