Skip to content

Instantly share code, notes, and snippets.

@ufobat
Created February 1, 2019 09:44
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 ufobat/a3e5683422640cf54f8ff2bf1898b4d7 to your computer and use it in GitHub Desktop.
Save ufobat/a3e5683422640cf54f8ff2bf1898b4d7 to your computer and use it in GitHub Desktop.
use v6.c;
use JSON::Fast;
use LibCurl::HTTP :subs;
sub MAIN(
Str :$url = 'https://ecosystem-api.p6c.org/projects1.json',
Str :$file,
) {
my @modules;
if $file and $file.IO.e {
@modules = slip from-json($file.IO.slurp)
} elsif $url {
@modules = slip jget($url);
} else {
die;
}
for @modules {
say .<name>, ' -> ', .<version>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment