Skip to content

Instantly share code, notes, and snippets.

@akluth
Created January 28, 2014 09:09
Show Gist options
  • Select an option

  • Save akluth/8664422 to your computer and use it in GitHub Desktop.

Select an option

Save akluth/8664422 to your computer and use it in GitHub Desktop.

Revisions

  1. Alexander Kluth revised this gist Jan 28, 2014. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions getrepos.pl
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,11 @@
    use strict;
    use warnings;
    use LWP::Simple;
    use LWP::UserAgent;
    use JSON;
    use Data::Dumper;

    my $json = get("https://api.github.com/users/deralex/repos");

    my $data =decode_json($json);
    my $data = decode_json($json);

    my $target = $ARGV[0];

  2. Alexander Kluth created this gist Jan 28, 2014.
    22 changes: 22 additions & 0 deletions getrepos.pl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/usr/bin/perl
    #
    use strict;
    use warnings;
    use LWP::Simple;
    use LWP::UserAgent;
    use JSON;
    use Data::Dumper;

    my $json = get("https://api.github.com/users/deralex/repos");

    my $data =decode_json($json);

    my $target = $ARGV[0];

    foreach my $chunk(@$data) {
    print "Cloning $chunk->{full_name}...";
    my @repo = split("/", $chunk->{full_name});;
    my $result = `git clone https://github.com/$chunk->{full_name} $target/$repo[1] &> /dev/null`;
    print "done.\n";

    }