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  -  WWW::GITHUB::GIST (3)

.ds Aq ’

NAME

WWW::GitHub::Gist - Perl interface to the GitHub’s pastebin service

CONTENTS

VERSION

version 0.17

SYNOPSIS



    use WWW::GitHub::Gist;

    my $gist = WWW::GitHub::Gist -> new(
      id       => 1216637,
      #user     => $username,
      #password => $password
    );

    # Fetch and print information
    my $gist_info = $gist -> show;

    say $gist_info -> {description};
    say $gist_info -> {user} -> {login};
    say $gist_info -> {git_pull_url};
    say $gist_info -> {git_push_url};

    # Show files
    my $files = $gist_info -> {files};

    foreach my $file (keys %$files) {
      say $files -> {$file} -> {filename};
      say $files -> {$file} -> {content};
    }

    # Create a new gist
    my $new_gist_info = $gist -> create(
      description => $descr,
      public => 1,
      files => {name1 => content, name2 => content}
    );



DESCRIPTION

WWW::GitHub::Gist provides an object-oriented interface for Perl to the gist.github.com API. Gist is a pastebin service operated by GitHub.

METHODS

    new( )

Create a new WWW::GitHub::Gist object. Takes the following arguments:
o id

Gist id.

o user

GitHub username.

o password

Authenticating user’s password.

The username and password are used for the methods that require auth. The username is also used in the list() method.

show( CW$gist_id )

Fetch information of the given gist. By default uses the ’id’ attribute defined in ->new.

Returns an hash ref containing the gist’s information.

list( CW$user )

List all gists of the given user. By default uses the ’user’ attribute defined in ->new.

Returns a list of hash refs containing the gists’ information.

create( CW%args )

Create a new gist. Takes the following arguments:
o description

The description for the new gist (optional).

o public

Whether the new gist is public or not (optional, defaults to ’1’).

o files

A hash reference containing the new gist’s file names and contents.

Returns an hash ref containing the new gist’s information.

If no credentials are provided, an anonymous gist will be created.

edit( CW%args )

Updates a gist. Takes the following arguments:
o id

The id of the gist to be updated. By default uses the ’id’ attribute defined in ->new.

o description

The updated description for the gist (optional).

o public

Whether the new gist is public or not (optional, defaults to ’1’).

o files

A hash reference containing the gist’s updated file names and conttents.

Returns an hash ref containing the updated gist’s information.

(requires authentication)

fork( CW$gist_id )

Forks the given gist. By default uses the ’id’ attribute defined in ->new.

Returns an hash ref containing the forked gist’s information.

(requires authentication)

delete( CW$gist_id )

Deletes the given gist. By default uses the ’id’ attribute defined in ->new.

Returns nothing.

(requires authentication)

star( CW$gist_id )

Stars the given gist. By default uses the ’id’ attribute defined in ->new.

Returns nothing.

(requires authentication)

unstar( CW$gist_id )

Unstars the given gist. By default uses the ’id’ attribute defined in ->new.

Returns nothing.

(requires authentication)

AUTHOR

Alessandro Ghedini <alexbio@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2011 Alessandro Ghedini.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

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


perl v5.20.3 WWW::GITHUB::GIST (3) 2012-08-30

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