Net::GitHub::V2::Issues - GitHub Issues API
use Net::GitHub::V2::Issues; my $issue = Net::GitHub::V2::Issues->new( owner => 'fayland', repo => 'perl-net-github' );
http://develop.github.com/p/issues.html
For those (authentication required) below, you must set login and token (in https://github.com/account)
my $issue = Net::GitHub::V2::Issues->new( owner => 'fayland', repo => 'perl-net-github', login => 'fayland', token => '54b5197d7f92f52abc5c7149b313cf51', # faked );
my $issues = $issue->search('open', 'test');
search issues
my $issues = $issue->list('open'); my $issues = $issue->list('closed');
see a list of issues for a project.
each issue is a hash reference which contains:
'number' => 2, 'position' => '1', 'state' => 'open', 'body' => 'Bug Detail', 'created_at' => '2009/04/20 10:00:45 -0700', 'updated_at' => '2009/04/20 10:00:45 -0700', 'user' => 'foobar', 'title' => 'Bug Title', 'votes' => 0
my $iss = $issue->view( $issues->[0]->{number} );
get data on an individual issue by number
my $iss = $issue->open( 'Bug title', 'Bug detail' );
open a new issue on a project (authentication required)
$issue->close( $number ); $issue->reopen( $number );
close or reopen an issue (authentication required)
$issue->edit( $number, 'New bug title', 'New bug detail' );
edit an existing issue (authentication required)
my $labels = $issue->add_label( $number, 'testing' ); my $labels = $issue->remove_label( $number, $label );
add/remove a label (authentication required)
my $comment = $issue->comment( $number, 'this is amazing' );
comment on issues
note: this is not the official api of github, in fact, it's done by scrapping.
my $comments = $issue->comments( $number );
return an arrayref containing a list of comments, each comment is a hashref like
{ id => 12345, author => 'foo', date => '2009/06/08 18:28:42 -0700', content => 'blalba', }
if no comments, return []
Fayland Lam, <fayland at gmail.com>
<fayland at gmail.com>
sunnavy <sunnavy@bestpractical.com>
<sunnavy@bestpractical.com>
Copyright 2009 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::GitHub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::GitHub
CPAN shell
perl -MCPAN -e shell install Net::GitHub
For more information on module installation, please visit the detailed CPAN module installation guide.