The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pithub - Github v3 API

VERSION

version 0.01003

SYNOPSIS

    use Pithub;
    use Data::Dumper;

    $p = Pithub->new;
    $result = $p->repos->get( user => 'plu', repo => 'Pithub' );

    # $result->content is either an arrayref or an hashref
    # depending on the API call that has been made
    printf "%s\n", $result->content->{html_url};     # prints https://github.com/plu/Pithub
    printf "%s\n", $result->content->{clone_url};    # prints https://github.com/plu/Pithub.git

    # if the result is an arrayref, you can use the result iterator
    $result = $p->repos->list( user => 'plu' );
    while ( my $row = $result->next ) {
        printf "%s\n", $row->{name};
    }

WARNING

Pithub as well as the Github v3 API are still under development. So there might be things broken on both sides. Besides that it's possible that the API will change. This applies to Pithub itself as well as the Github v3 API.

MODULES

There are different ways of using Pithub library. You can either use the main module Pithub to get access to all other modules like Pithub::Repos for example, or you can use Pithub::Repos directly. In the synopsis above, all the calls are equivalent. Here's an overview over all modules and how to get access to them:

Besides that there are other modules involved. Every method call which maps directly to a Github API call returns a Pithub::Result object. This contains everything interesting about the response (Pithub::Response) returned from the API call as well as the request (Pithub::Request). Even the Pithub::Base module might be interesting because this one provides the "request" in Pithub::Base method, which is used by all other modules. In case Github adds a new API call which is not supported yet by Pithub the "request" in Pithub::Base method can be used directly.

AUTHOR

Johannes Plunien <plu@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Johannes Plunien.

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