Skip to content

Commit 0c645a5

Browse files
author
Tadeusz Sośnierz
committed
Add a script producing projects.json
1 parent e4aa843 commit 0c645a5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

updatelist.pl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use 5.010;
2+
use JSON::XS;
3+
use File::Slurp 'slurp';
4+
use Try::Tiny;
5+
use LWP::Simple;
6+
use autodie;
7+
system "wget https://raw.githubusercontent.com/perl6/ecosystem/master/META.list -O metalist";
8+
9+
my @modules;
10+
11+
open my $fh, '<', "metalist";
12+
for(<$fh>) {
13+
chomp;
14+
try {
15+
print "$_ ";
16+
say getstore($_, 'tmp');
17+
my $hash = decode_json slurp 'tmp';
18+
push @modules, $hash;
19+
};
20+
unlink 'tmp' if -e 'tmp';
21+
}
22+
close $fh;
23+
#unlink 'metalist';
24+
25+
open($fh, '>', "/home/tjs/modules/public/projects.json");
26+
27+
print $fh encode_json \@modules;
28+
close $fh;

0 commit comments

Comments
 (0)