[libnet-github-perl] 01/04: Imported Upstream version 0.54

Angel Abad angel at alioth.debian.org
Tue Oct 8 16:54:33 UTC 2013


This is an automated email from the git hooks/post-receive script.

angel pushed a commit to branch master
in repository libnet-github-perl.

commit 1c66f543055de932fc1ffc046c3d461509d7e984
Author: Angel Abad <angelabad at gmail.com>
Date:   Tue Oct 8 18:46:15 2013 +0200

    Imported Upstream version 0.54
---
 Changes                    |    3 +++
 META.yml                   |    2 +-
 lib/Net/GitHub.pm          |    2 +-
 lib/Net/GitHub/V3/Users.pm |   32 ++++++++++++++++++++++++++------
 4 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/Changes b/Changes
index ca783c8..5e2c6e3 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Net-GitHub
 
+0.54    2013.09.25
+        - $user->contributions (mikegrb)(Rev Michael Greb)
+
 0.53    2013.09.01
         - listing all public repos (kimmel)
 
diff --git a/META.yml b/META.yml
index 2345a3d..c66e3a5 100644
--- a/META.yml
+++ b/META.yml
@@ -37,4 +37,4 @@ requires:
 resources:
   license: http://dev.perl.org/licenses/
   repository: https://github.com/fayland/perl-net-github
-version: 0.53
+version: 0.54
diff --git a/lib/Net/GitHub.pm b/lib/Net/GitHub.pm
index c633023..9329af4 100644
--- a/lib/Net/GitHub.pm
+++ b/lib/Net/GitHub.pm
@@ -3,7 +3,7 @@ package Net::GitHub;
 use Any::Moose;
 use Net::GitHub::V3;
 
-our $VERSION = '0.53';
+our $VERSION = '0.54';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 sub new {
diff --git a/lib/Net/GitHub/V3/Users.pm b/lib/Net/GitHub/V3/Users.pm
index 7b6320a..bdbbc68 100644
--- a/lib/Net/GitHub/V3/Users.pm
+++ b/lib/Net/GitHub/V3/Users.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Users;
 
 use Any::Moose;
 
-our $VERSION = '0.40';
+our $VERSION = '0.54';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 use URI::Escape;
@@ -11,7 +11,7 @@ with 'Net::GitHub::V3::Query';
 
 sub show {
     my ( $self, $user ) = @_;
-    
+
     my $u = $user ? "/users/" . uri_escape($user) : '/user';
     return $self->query($u);
 }
@@ -19,7 +19,7 @@ sub show {
 sub update {
     my $self = shift;
     my $data = @_ % 2 ? shift @_ : { @_ };
-    
+
     return $self->query('PATCH', '/user', $data);
 }
 
@@ -31,22 +31,32 @@ sub remove_email {
 }
 sub followers {
     my ($self, $user) = @_;
-    
+
     my $u = $user ? "/users/" . uri_escape($user) . '/followers' : '/user/followers';
     return $self->query($u);
 }
 sub following {
     my ($self, $user) = @_;
-    
+
     my $u = $user ? "/users/" . uri_escape($user) . '/following' : '/user/following';
     return $self->query($u);
 }
 
+sub contributions {
+    my ( $self, $user ) = @_;
+    my $path = "/users/" . uri_escape($user) . "/contributions_calendar_data";
+    my $domain
+        = $self->api_url eq 'https://api.github.com'
+        ? 'https://github.com'
+        : $self->api_url;
+    return $self->query( $domain . $path );
+}
+
 ## build methods on fly
 my %__methods = (
 
     emails => { url => "/user/emails" },
-    
+
     is_following => { url => "/user/following/%s", check_status => 204 },
     follow => { url => "/user/following/%s", method => 'PUT', check_status => 204 },
     unfollow => { url => "/user/following/%s", method => 'DELETE', check_status => 204 },
@@ -175,6 +185,16 @@ L<http://developer.github.com/v3/users/keys/>
     });
     $user->delete_key($key_id);
 
+=item contributions
+
+    my $contributions = $user->contributions($username);
+    # $contributions = ( ..., ['2013/09/22', 3], [ '2013/09/23', 2 ] )
+
+Unpublished GitHub API used to build the 'Public contributions' graph on a
+users' profile page.  The data structure is a list of 365 arrayrefs, one per day.
+Each array has two elements, the date in YYYY/MM/DD format is the first element,
+the second is the number of contrubtions for that day.stree .
+
 =back
 
 =head1 AUTHOR & COPYRIGHT & LICENSE

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-github-perl.git



More information about the Pkg-perl-cvs-commits mailing list