The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::API::CPAN::Author - Meta CPAN API Author Class

SYNOPSIS

    use Net::API::CPAN::Author;
    my $obj = Net::API::CPAN::Author->new( {
      asciiname => "Taro Momo",
      blog => [
        {
          feed => "",
          url => "https://momotaro.example.jp/",
        },
        {
          feed => "https://blogs.perl.org/users/momotaro/atom.xml",
          url => "https://blogs.perl.org/users/momotaro/",
        },
      ],
      city => "Okayama",
      country => "JP",
      donation => [
        {
          id => "momo.taro\@example.jp",
          name => "stripe",
        },
      ],
      email => [
        "momo.taro\@example.jp",
      ],
      gravatar_url => "https://secure.gravatar.com/avatar/a123abc456def789ghi0jkl?s=130&d=identicon",
      links => {
        backpan_directory => "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO",
        cpan_directory => "http://cpan.org/authors/id/M/MO/MOMOTARO",
        cpantesters_matrix => "http://matrix.cpantesters.org/?author=MOMOTARO",
        cpantesters_reports => "http://cpantesters.org/author/M/MOMOTARO.html",
        cpants => "http://cpants.cpanauthors.org/author/MOMOTARO",
        metacpan_explorer => "https://explorer.metacpan.org/?url=/author/MOMOTARO",
        repology => "https://repology.org/maintainer/MOMOTARO%40cpan",
      },
      location => [
        "34.7338553",
        "133.7660595",
      ],
      name => "\x{6843}\x{592a}\x{90ce}",
      pauseid => "MOMOTARO",
      perlmongers => [
        {
          name => "momo.taro",
        },
      ],
      profile => [
        {
          id => "momotaro",
          name => "coderwall",
        },
        {
          id => "momotaro",
          name => "github",
        },
        {
          id => "momotaro",
          name => "linkedin",
        },
        {
          id => "momotaro",
          name => "twitter",
        },
        {
          id => "momotaro",
          name => "gitlab",
        },
      ],
      region => "Okayama",
      release_count => {
        "backpan-only" => 12,
        cpan => 420,
        latest => 17,
      },
      updated => "2023-07-29T04:45:10",
      user => "j_20ap7aNOkaYA11m9a2",
      website => [
        "https://www.momotaro.jp/",
      ],
    } ) || die( Net::API::CPAN::Author->error );
    
    my $string = $obj->asciiname;
    my $array = $obj->blog;
    foreach my $this ( @$array )
    {
        my $scalar = $this->feed;
        my $uri = $this->url;
    }
    my $string = $obj->city;
    my $string = $obj->country;
    my $string = $obj->dir;
    my $array = $obj->donation;
    foreach my $this ( @$array )
    {
        my $scalar = $this->id;
        my $scalar = $this->name;
    }
    my $array = $obj->email;
    my $uri = $obj->gravatar_url;
    my $bool = $obj->is_pause_custodial_account;
    my $this = $obj->links;
    my $uri = $obj->links->backpan_directory;
    my $uri = $obj->links->cpan_directory;
    my $uri = $obj->links->cpantesters_matrix;
    my $uri = $obj->links->cpantesters_reports;
    my $uri = $obj->links->cpants;
    my $uri = $obj->links->metacpan_explorer;
    my $uri = $obj->links->repology;
    my $array = $obj->location;
    my $uri = $obj->metacpan_url;
    my $string = $obj->name;
    my $str = $obj->object;
    my $string = $obj->pauseid;
    my $array = $obj->perlmongers;
    foreach my $this ( @$array )
    {
        my $scalar = $this->name;
        my $uri = $this->url;
    }
    my $array = $obj->profile;
    foreach my $this ( @$array )
    {
        my $scalar = $this->id;
        my $scalar = $this->name;
    }
    my $string = $obj->region;
    my $this = $obj->release_count;
    my $integer = $obj->release_count->backpan_only;
    my $integer = $obj->release_count->cpan;
    my $integer = $obj->release_count->latest;
    my $this = $obj->releases;
    my $date = $obj->updated;
    my $string = $obj->user;
    my $array = $obj->website;

VERSION

    v0.1.0

DESCRIPTION

This class serves to retrieve and manipulate authors.

It inherits from Net::API::CPAN::Generic

CONSTRUCTOR

new

Provided with an hash or hash reference of parameters, and this instantiates a new Net::API::CPAN::Author object.

The parameters that can be provided bear the same name and supports the same values as the methods below.

METHODS

asciiname

    $obj->asciiname( "Taro Momo" );
    my $string = $obj->asciiname;

Sets or gets a string and returns a scalar object, even if there is no value.

blog

    $obj->blog( [
      {
        feed => "",
        url => "https://momotaro.example.jp/",
      },
      {
        feed => "https://blogs.perl.org/users/momotaro/atom.xml",
        url => "https://blogs.perl.org/users/momotaro/",
      },
    ] );
    my $array = $obj->blog;
    foreach my $this ( @$array )
    {
        my $scalar = $this->feed;
        $this->url( "https://momotaro.example.jp/" );
        my $uri = $this->url;
    }

Sets or gets an array of dynamic class objects with class name Net::API::CPAN::Author::Blog and having the folowing properties also accessible as methods, and returns an array object even if there is no value.

A Net::API::CPAN::Author::Blog object will be instantiated with each value from the array provided and replace said value.

city

    $obj->city( "Okayama" );
    my $string = $obj->city;

Sets or gets a string and returns a scalar object, even if there is no value.

country

    $obj->country( "JP" );
    my $string = $obj->country;

Sets or gets a string and returns a scalar object, even if there is no value.

dir

Sets or gets the cpan_directory link property.

This is actually a shortcut to accessing the property cpan_directory in "links"

It returns an URI object, or undef if no value is set.

donation

    $obj->donation( [
      {
        id => "momo.taro\@example.jp",
        name => "stripe",
      },
    ] );
    my $array = $obj->donation;
    foreach my $this ( @$array )
    {
        $this->id( "momo.taro\@example.jp" );
        my $scalar = $this->id;
        $this->name( "stripe" );
        my $scalar = $this->name;
    }

Sets or gets an array of dynamic class objects with class name Net::API::CPAN::Author::Donation and having the folowing properties also accessible as methods, and returns an array object even if there is no value.

A Net::API::CPAN::Author::Donation object will be instantiated with each value from the array provided and replace said value.

  • id scalar_as_object

  • name scalar_as_object

email

    $obj->email( [
      "momo.taro\@example.jp",
    ] );
    my $array = $obj->email;

Sets or gets an array of Email::Address::XS objects, or creates an Email::Address::XS instance for each email provided in the array, and returns an array object, even if no value was provided.

gravatar_url

    $obj->gravatar_url( "https://secure.gravatar.com/avatar/a123abc456def789ghi0jkl?s=130&d=identicon" );
    my $uri = $obj->gravatar_url;

Sets or gets an URI, and returns an URI object or undef if no value is set.

is_pause_custodial_account

Sets or gets a boolean value, and returns a boolean object or undef if no value is set.

    $obj->links( {
      backpan_directory => "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO",
      cpan_directory => "http://cpan.org/authors/id/M/MO/MOMOTARO",
      cpantesters_matrix => "http://matrix.cpantesters.org/?author=MOMOTARO",
      cpantesters_reports => "http://cpantesters.org/author/M/MOMOTARO.html",
      cpants => "http://cpants.cpanauthors.org/author/MOMOTARO",
      metacpan_explorer => "https://explorer.metacpan.org/?url=/author/MOMOTARO",
      repology => "https://repology.org/maintainer/MOMOTARO%40cpan",
    } );
    my $this = $obj->links;
    $obj->links->backpan_directory( "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO" );
    my $uri = $obj->links->backpan_directory;
    $obj->links->cpan_directory( "http://cpan.org/authors/id/M/MO/MOMOTARO" );
    my $uri = $obj->links->cpan_directory;
    $obj->links->cpantesters_matrix( "http://matrix.cpantesters.org/?author=MOMOTARO" );
    my $uri = $obj->links->cpantesters_matrix;
    $obj->links->cpantesters_reports( "http://cpantesters.org/author/M/MOMOTARO.html" );
    my $uri = $obj->links->cpantesters_reports;
    $obj->links->cpants( "http://cpants.cpanauthors.org/author/MOMOTARO" );
    my $uri = $obj->links->cpants;
    $obj->links->metacpan_explorer( "https://explorer.metacpan.org/?url=/author/MOMOTARO" );
    my $uri = $obj->links->metacpan_explorer;
    $obj->links->repology( "https://repology.org/maintainer/MOMOTARO%40cpan" );
    my $uri = $obj->links->repology;

Sets or gets a dynamic class object with class name Net::API::CPAN::Author::Links and having the folowing properties also accessible as methods, and returns an object from such class, or undef if no value was provided.

location

    $obj->location( [
      "34.7338553",
      "133.7660595",
    ] );
    my $array = $obj->location;

Sets or gets an array of locations and returns an array object, even if there is no value.

metacpan_url

Returns a link, as an URI object, to the author's page on MetaCPAN, or undef if no pauseid is currently set.

name

    $obj->name( "\x{6843}\x{592a}\x{90ce}" );
    my $string = $obj->name;

Sets or gets a string and returns a scalar object, even if there is no value.

object

Returns the object type for this class, which is author

pauseid

    $obj->pauseid( "MOMOTARO" );
    my $string = $obj->pauseid;

Sets or gets a string and returns a scalar object, even if there is no value.

perlmongers

    $obj->perlmongers( [
      {
        name => "momo.taro",
      },
    ] );
    my $array = $obj->perlmongers;
    foreach my $this ( @$array )
    {
        $this->name( "momo.taro" );
        my $scalar = $this->name;
        my $uri = $this->url;
    }

Sets or gets an array of dynamic class objects with class name Net::API::CPAN::Author::Perlmongers and having the folowing properties also accessible as methods, and returns an array object even if there is no value.

A Net::API::CPAN::Author::Perlmongers object will be instantiated with each value from the array provided and replace said value.

profile

    $obj->profile( [
      {
        id => "momotaro",
        name => "coderwall",
      },
      {
        id => "momotaro",
        name => "github",
      },
      {
        id => "momotaro",
        name => "linkedin",
      },
      {
        id => "momotaro",
        name => "twitter",
      },
      {
        id => "momotaro",
        name => "gitlab",
      },
    ] );
    my $array = $obj->profile;
    foreach my $this ( @$array )
    {
        $this->id( "momotaro" );
        my $scalar = $this->id;
        $this->name( "coderwall" );
        my $scalar = $this->name;
    }

Sets or gets an array of dynamic class objects with class name Net::API::CPAN::Author::Profile and having the folowing properties also accessible as methods, and returns an array object even if there is no value.

A Net::API::CPAN::Author::Profile object will be instantiated with each value from the array provided and replace said value.

  • id scalar_as_object

  • name scalar_as_object

region

    $obj->region( "Okayama" );
    my $string = $obj->region;

Sets or gets a string and returns a scalar object, even if there is no value.

release_count

    $obj->release_count( {
      "backpan-only" => 12,
      cpan => 420,
      latest => 17,
    } );
    my $this = $obj->release_count;
    my $integer = $obj->release_count->backpan_only;
    $obj->release_count->cpan( 420 );
    my $integer = $obj->release_count->cpan;
    $obj->release_count->latest( 17 );
    my $integer = $obj->release_count->latest;

Sets or gets a dynamic class object with class name Net::API::CPAN::Author::ReleaseCount and having the folowing properties also accessible as methods, and returns an object from such class, or undef if no value was provided.

releases

Returns an Net::API::CPAN::ResultSet oject containing all the author latest releases as release objects.

updated

    $obj->updated( "2023-07-29T04:45:10" );
    my $datetime_obj = $obj->updated;

Sets or gets a datetime value, and returns a DateTime object that stringifies to the format that was provided with the string set (usally an ISO 8601 datetime format) or undef if no value is set.

user

    $obj->user( "j_20ap7aNOkaYA11m9a2" );
    my $string = $obj->user;

Sets or gets a string and returns a scalar object, even if there is no value.

website

    $obj->website( [
      "https://www.momotaro.jp/",
    ] );
    my $array = $obj->website;

Sets or gets an array of URI objects, or creates an URI instance for each website provided in the array, and returns an array object, even if no value was provided.

API SAMPLE

    {
       "asciiname" : "Taro Momo",
       "blog" : [
          {
             "feed" : "",
             "url" : "https://momotaro.example.jp/"
          },
          {
             "feed" : "https://blogs.perl.org/users/momotaro/atom.xml",
             "url" : "https://blogs.perl.org/users/momotaro/"
          },
       ],
       "city" : "Okayama",
       "country" : "JP",
       "donation" : [
          {
             "name" : "stripe",
             "id" : "momo.taro@example.jp"
          }
       ],
       "perlmongers": [
          {
             "name": "momo.taro"
          }
       ],
       "email" : [
          "momo.taro@example.jp"
       ],
       "gravatar_url" : "https://secure.gravatar.com/avatar/a123abc456def789ghi0jkl?s=130&d=identicon",
       "links" : {
          "backpan_directory" : "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO",
          "cpan_directory" : "http://cpan.org/authors/id/M/MO/MOMOTARO",
          "cpantesters_matrix" : "http://matrix.cpantesters.org/?author=MOMOTARO",
          "cpantesters_reports" : "http://cpantesters.org/author/M/MOMOTARO.html",
          "cpants" : "http://cpants.cpanauthors.org/author/MOMOTARO",
          "metacpan_explorer" : "https://explorer.metacpan.org/?url=/author/MOMOTARO",
          "repology" : "https://repology.org/maintainer/MOMOTARO%40cpan"
       },
       "location" : [
          34.7338553,
          133.7660595
       ],
       "name" : "桃太郎",
       "pauseid" : "MOMOTARO",
       "profile" : [
          {
             "id" : "momotaro",
             "name" : "coderwall"
          },
          {
             "id" : "momotaro",
             "name" : "github"
          },
          {
             "id" : "momotaro",
             "name" : "linkedin"
          },
          {
             "id" : "momotaro",
             "name" : "twitter"
          },
          {
             "id" : "momotaro",
             "name" : "gitlab"
          }
       ],
       "region" : "Okayama",
       "release_count" : {
          "backpan-only" : 12,
          "cpan" : 420,
          "latest" : 17
       },
       "updated" : "2023-07-29T04:45:10",
       "user" : "j_20ap7aNOkaYA11m9a2",
       "website" : [
          "https://www.momotaro.jp/"
       ]
    }

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Net::API::CPAN, Net::API::CPAN::Activity, Net::API::CPAN::Author, Net::API::CPAN::Changes, Net::API::CPAN::Changes::Release, Net::API::CPAN::Contributor, Net::API::CPAN::Cover, Net::API::CPAN::Diff, Net::API::CPAN::Distribution, Net::API::CPAN::DownloadUrl, Net::API::CPAN::Favorite, Net::API::CPAN::File, Net::API::CPAN::Module, Net::API::CPAN::Package, Net::API::CPAN::Permission, Net::API::CPAN::Rating, Net::API::CPAN::Release

MetaCPAN::API, MetaCPAN::Client

https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md

COPYRIGHT & LICENSE

Copyright(c) 2023 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.