We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e6623f commit 8fd475bCopy full SHA for 8fd475b
bin/river.pl
@@ -3,15 +3,23 @@
3
use v5.36;
4
5
use Cpanel::JSON::XS qw< decode_json >;
6
+use Getopt::Long;
7
+use Path::Tiny qw< path >;
8
9
use MetaCPAN::Logger qw< :log :dlog >;
10
11
use MetaCPAN::ES;
12
use MetaCPAN::Ingest qw< read_url >;
13
14
+# args
15
+my ( $json );
16
+GetOptions(
17
+ "json=s" => \$json,
18
+);
19
+
20
# setup
21
my $river_url //= 'https://neilb.org/river-of-cpan.json.gz';
-my $river_data = decode_json( read_url($river_url) );
22
+my $river_data = decode_json( $json ? path($json)->slurp : read_url($river_url) );
23
24
my $es = MetaCPAN::ES->new( index => "distribution" );
25
my $bulk = $es->bulk();
0 commit comments