NAME
Github::Score - Pull author contribution counts for github repos
VERSION
version 0.2.0
AUTHOR
justin.d.hunter@gmail.com
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by AHB.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
NAME
Github::Score - Collect contributions data from the Github api.
SYNOPSIS
my $gs1 = Github::Score->new();
$gs1 ->user( 'Getty' );
$gs1 ->repo( 'p5-www-duckduckgo' );
my $contributors_scores = $gs1 ->scores();
my $gs2 = Github::Score->new( user => 'Getty' , repo => 'p5-www-duckduckgo' );
$contributors_scores = $gs2 ->scores();
my $gs3 = Github::Score->new( 'Getty/p5-www-duckduckgo' );
$contributors_scores = $gs3 ->scores();
$gs3 ->timeout(9.99);
$contributors_scores = $gs3 ->scores();
|
DESCRIPTION
feel where you can look up the author contribution counts for projecs on Github.
Github::Score is an OO perl API to the same data from the site aimed at the
DuckDuckGo community platform.
|
METHODS
Constructors
new
Github::Score objects can be constructed in different ways:
|
- Empty constructor call
-
new()
- Single url-style string
-
new('contributor/github-repo')
- Key-value pairs
-
new(user=>someone, repo=>'some-repo', timeout=> $_10_if_you_leave_it_out)
- Hash reference
-
new( {user=>someone, repo=>'some-repo', timeout=> $_10_if_you_leave_it_out)}
Accessors
user
Will set $self ->{user} to $_ [0], if an argument is given .
Returns: $self ->{user}
|
repo
Will set $self -{repo} to $_ [0], if an argument is given .
Returns: $self -{repo}
|
timeout
Will set $self ->{timeout} to $_ [0], if an argument is given .
Returns: $self ->{timeout}
Note: Defaults to 10 when the object is constructed.
|
ua
Returns: A LWP::UserAgent instance
Note: Do not use this method directly. It is automatically invoked by the scores method.
|
uri
Returns: A URI instance
Note: Do not use this method directly. It is automatically invoked by the scores method.
|
json
Returns: A JSON instance
Note: Do not use this method directly. It is automatically invoked by the scores method.
|
Behaviour
scores
Returns: A reference to a hash of login/contribution pairs.
Note: The hash could be empty if there is some error with the request,
or example a timeout, or if the query is invalid, for example user
does not contribute to the repository.
|
BUGS
None known, but they will be there somewhere.
|
TODO
- Github api v3 support
-
- Support regex user/repo queries
-
- Retry on timeout?
-
- Better documentation.
-
SEE ALSO
- http://github-high-scores.heroku.com/
-
- Net::GitHub
-
- http://github.com
-
- App::DuckDuckGo
-
- WWW::DuckDuckGo
-
- http://duck.co/
-