Skip to content

Instantly share code, notes, and snippets.

@samcv
Created April 20, 2017 02:17
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 samcv/51e8a1fd862ad512a7983a1006c176e2 to your computer and use it in GitHub Desktop.
Save samcv/51e8a1fd862ad512a7983a1006c176e2 to your computer and use it in GitHub Desktop.
use JSON::Fast;
use v6.d.PREVIEW;
my $lock = Lock.new;
my @list;
say "getting list";
my $list = qx{curl -s 'https://raw.githubusercontent.com/perl6/ecosystem/master/META.list'};
say "got list";
await do for $list.lines -> $url {
start {
#say $url;
my $proc = run 'curl', '-s', $url, :out;
my Str $out = $proc.out.slurp;
my $result;
try {
$result = from-json($out);
};
#say $result;
$lock.protect({
@list.append($result.keys);
#say @list;
}) if $proc.exitcode == 0 and $result;
print '.';
}
}
print "\n";
Bag(@list).say;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment