Created
November 10, 2015 13:52
-
-
Save jonathanstowe/f198f80ac53ed0b74b3e to your computer and use it in GitHub Desktop.
The most depended on Perl 6 modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use HTTP::UserAgent; | |
use JSON::Tiny; | |
my $ua = HTTP::UserAgent.new; | |
my Array %mods; | |
my $json = $ua.get('http://ecosystem-api.p6c.org/projects.json').content; | |
my $data = from-json($json); | |
for $data.list -> $project { | |
if $project<depends>:exists { | |
for $project<depends>.list -> $depend { | |
if $depend.defined { | |
%mods{$depend}.push($project<name>); | |
} | |
} | |
} | |
} | |
for %mods.kv.map(-> $k,$v { [ $k, $v ] }).sort(-> $a { $a[1].elems } ) -> $v { | |
say $v[0], " ",$v[1].elems; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment