GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PITHUB::REPOS::CONTENTS (3)

.ds Aq ’

NAME

Pithub::Repos::Contents - Github v3 Repo Contents API

CONTENTS

VERSION

version 0.01033

METHODS

    archive

o This method will return a 302 to a URL to download a tarball or zipball archive for a repository.

Note: For private repositories, these links are temporary and expire quickly.



    GET /repos/:user/:repo/:archive_format/:ref



The ref parameter is optional and will default to master.

Examples:



    use Path::Tiny;

    my $c = Pithub::Repos::Contents->new(
        repo => Pithub,
        user => plu
    );

    my $result = $c->archive( archive_format => tarball );
    if ( $result->success ) {
        path(Pithub-master.tgz)->spew($result->raw_content);
    }

    $result = $c->archive( archive_format => tarball, ref => other_branch );
    if ( $result->success ) {
        path(Pithub-other_branch.tgz)->spew($result->raw_content);
    }



    get

o This method returns the contents of any file or directory in a repository.



    GET /repos/:user/:repo/contents/:path



Optional Parameters:
o <B>refB>: Optional string - The String name of the Commit/Branch/Tag. Defaults to master.

Examples:



    my $c = Pithub::Repos::Contents->new(
        repo => Pithub,
        user => plu
    );

    # List all files/directories in the repo root
    my $result = $c->get;
    if ( $result->success ) {
        say $_->{name} for @{ $result->content };
    }

    # Get the Pithub.pm file
    $result = $c->get( path => lib/Pithub.pm );
    print Dumper $result->content if $result->success;



    readme

o This method returns the preferred README for a repository.



    GET /repos/:user/:repo/readme



Optional Parameters:
o <B>refB>: Optional string - The String name of the Commit/Branch/Tag. Defaults to master.

Examples:



    my $c = Pithub::Repos::Contents->new(
        repo => dotfiles,
        user => plu
    );

    my $result = $c->readme;
    if ( $result->success ) {
        print Dumper $result->content;
    }

    # Get the readme of branch other_branch
    $result = $c->readme( params => { ref => other_branch } );
    print Dumper $result->content if $result->success;



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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PITHUB::REPOS::CONTENTS (3) 2016-01-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.