Skip to content

Instantly share code, notes, and snippets.

@gerjantd
Created April 22, 2012 18:02
Show Gist options
  • Save gerjantd/2465765 to your computer and use it in GitHub Desktop.
Save gerjantd/2465765 to your computer and use it in GitHub Desktop.
Github: API v1 call for retrieving my public gists (obsolete)
wget -O `date +%Y%m%d`-gerjantd-public-gists.json http://gist.github.com/api/v1/json/gists/gerjantd
Format the downloaded json:
sudo apt-get install libjson-perl
sudo apt-get install curl
curl http://gist.github.com/api/v1/json/gists/gerjantd | json_xs
Automate cloning of all gists:
mkdir mygists
cd mygists
curl -s http://gist.github.com/api/v1/json/gists/gerjantd | json_xs |grep "\"repo\""|awk -F "\"" '{print $4}' > repos
for g in `cat repos`; do git clone [email protected]:$g.git gist-$g; done
rm repos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment