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
WWW::GitHub::Gist(3) User Contributed Perl Documentation WWW::GitHub::Gist(3)

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

version 0.17

    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'}
    );

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

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

    Gist id.

  • "user"

    GitHub username.

  • "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.

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 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 a new gist. Takes the following arguments:
  • "description"

    The description for the new gist (optional).

  • "public"

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

  • "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.

Updates a gist. Takes the following arguments:
  • "id"

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

  • "description"

    The updated description for the gist (optional).

  • "public"

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

  • "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)

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)

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

Returns nothing.

(requires authentication)

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

Returns nothing.

(requires authentication)

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

Returns nothing.

(requires authentication)

Alessandro Ghedini <alexbio@cpan.org>

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.

2012-08-30 perl v5.32.1

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

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