nger::CPAN;
use 5.010;
use common::sense;
use utf8;
use Digest::MD5 0 qw(md5_hex);
use JSON 2.00 qw(from_json);
use LWP::Simple 0 qw(get);
use parent qw(WWW::Finger);
BEGIN {
$WWW::Finger::CPAN::
uri = sprintf('http://api.metacpan.org/v0/author/%s', uc $user);
$self->{metacpan_data} = from_json(get($uri));
}
$self->{metacpan_data};
}
sub releases
{
my $self = shift;
unless ($self->
0AND%%20status:latest&size=100', uc $user);
$self->{releases} = [ map { $_->{_source} } @{ from_json(get($uri))->{hits}->{hits} } ];
}
return wantarray
? @{ $self->{releases} }
: scalar @{ $
ount descriptor URI is fetched via HTTP GET with an Accept header
asking for RDF/XML, Turtle, RDF/JSON or XRD. The result is parsed for account
description data if it has status code 200 (OK).
The fo
content_type =~ m`(n3|turtle|text/plain)`;
$parser = RDF::Trine::Parser::RDFJSON->new if $response->content_type =~ m`(json)`;
$parser = RDF::Trine::Parser::RDFXML->new unless defined $parser;
$pa
>env_proxy;
$ua->default_header('Accept' => 'application/rdf+xml, text/turtle, application/x-rdf+json');
my $response = $ua->get($uri);
if ($response->is_success)
{
$self->_response_into_mod
WWW::Finger::BitworkingFingerProtocol;
use 5.010;
use common::sense;
use utf8;
use Carp 0;
use JSON 2.00;
use LWP::UserAgent 0;
use URI 0;
use URI::Escape 0;
use parent qw(WWW::Finger);
BEGIN {
UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->default_header('Accept' => 'application/json');
my $host_get = $ua->get("http://$host/.well-known/finger");
return undef unless $host_ge
pe :-(
### return undef unless $host_get->content_type =~ m#^application/(\S+\+)?json$#i;
my $host_data = from_json( $host_get->decoded_content );
my $template = $host_data->{'finger'};
retur