NAME

MetaCPAN::API::Author - Author information for MetaCPAN::API

VERSION

version 0.02

DESCRIPTION

This role provides MetaCPAN::API with several methods to get the author information.

ATTRIBUTES

author_prefix

This attribute helps set the path to the author requests in the REST API. You will most likely never have to touch this as long as you have an updated version of MetaCPAN::API.

Default: author.

This attribute is read-only (immutable), meaning that once it's set on initialize (via new()), you cannot change it. If you need to, create a new instance of MetaCPAN::API. Why is it immutable? Because it's better.

METHODS

search_author

my @authors = $mcpan->search_author('Dave');

This method is the DWIM interface for the author searches. It tries to do what you probably want. It does so in the following steps:

1. Trimming leading and trailing spaces
2. Checks if it's possibly a PAUSE ID

If there are no spaces, meaning it's a single word, it's assumed to optionally be a PAUSE ID, so it searches it as a PAUSE ID.

3. Searches by author name

As if you gave "Olaf Alders" as the search.

4. Searches by wildcard

As if you gave "Olaf" but want to find anything with Olaf in it.

It stacks the results on top of each other, so you find the PAUSE ID (if there is one) first, the full name search second and the wildcards last. The purpose is to try to get as accurate results as possible first time around.

Feel free to submit patches to improve this!

search_author_pauseid

my $author = $mcpan->search_author_pauseid('XSAWYERX');

Searches MetaCPAN for a specific PAUSE ID.

search_author_name

my $author = $mcpan->search_author_name('Sawyer X');

Searches MetaCPAN for a specific name.

search_author_wildcard

my $author = $mcpan->search_author_wildcard('Dave');

Searches MetaCPAN for an author using a string, and full wildcard on both sides. Equivalent to searching *Dave*.

AUTHOR

Sawyer X <xsawyerx@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Sawyer X.

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