in reply to cpanr - view cpan ratings from the command line
Hi,
use Mojo::DOM and WWW::Mechanize?
:D
... use ojo; # use Mojo::DOM; # use WWW::Mechanize; ... # my $mech = WWW::Mechanize->new(); # $mech->get($ratingsURL); # # my $dom = Mojo::DOM->new($mech->content()); my $dom = g( $ratingsURL )->dom;
https://metacpan.org/pod/ojo#g
update: it didn't work for ojo, so to make that work, fetch the distribution name instead of guessing it
# $module =~ s/::/-/g; $module = g('http://api.metacpan.org/v0/module/'.$module)->json->{ +distribution};
ref https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md, https://metacpan.org/pod/Mojo::Message#json
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cpanr - view cpan ratings from the command line ( ojo::g )
by marto (Cardinal) on Oct 06, 2016 at 09:22 UTC | |
by Your Mother (Archbishop) on Oct 06, 2016 at 23:04 UTC |