MetaCPAN::API gets updated

Recently I found some spare tuits and decided to spend them on MetaCPAN::API.

My main problem with the old MetaCPAN::API was that I had made a wrong design decision, and failed to take into account the flexibility of MetaCPAN. It really is flexible.

The second time around I decided I'll write it correctly, and test it thoroughly. I've moved to version 'v0' of the API (what was referred to as 'Beta API') and this helped clean up quite a bit. I was able to write it the way I wanted.

Tim Bunce (who I actually had the pleasure of meeting last YAPC::EU) had opened a ticket asking for complex POST requests. This got me thinking and that day I implemented complex GET requests, paving the way to the aforementioned POST requests.

So what's in MetaCPAN::API right now?

  • It has /pod, /release, /file, /module, /author - in all variations.
    my $mcpan  = MetaCPAN::API->new();
    my $author = $mcpan->author('XSAWYERX');
    my $dist   = $mcpan->release( distribution => 'MetaCPAN::API' );
    
  • It has tests for all of this.
  • It supports complex GET requests
    # example lifted from MetaCPAN docs
    my $result = $mcpan->release(
        search => {
            author => "OALDERS AND ",
            filter => "status:latest",
            fields => "name",
            size   => 1,
        },
    );
    

What will it support in the future?

  • Tim has given an example of how to simply implement POST requests which I intend to incorporate soon enough. This will pretty much cover everything shown in MetaCPANExplorer and MetaCPAN docs.
  • MetaCPAN::API::Predefined will carry predefined searches people find useful, such as "get all releases by this author", or "find all releases from the past year, month, week, day" and so on. This will grown with and by user input. That means you!

MetaCPAN is a growing project, and it's growing both extremely rapidly and with a lot of (very positive) feedback from the community. MetaCPAN::API hopes to make it easier for you to use and incorporate MetaCPAN in your applications.

You can follow MetaCPAN::API using its github page.

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz