r70705 - in /trunk/libnet-github-perl: Changes MANIFEST META.yml debian/changelog debian/control lib/Net/GitHub.pm lib/Net/GitHub/V2/Issues.pm t/v2/

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Sun Mar 6 16:18:48 UTC 2011


Author: ghedo-guest
Date: Sun Mar  6 16:18:33 2011
New Revision: 70705

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70705
Log:
* New upstream release
* Bump debhelper to 8
* Add myself to Uploaders

Removed:
    trunk/libnet-github-perl/t/v2/
Modified:
    trunk/libnet-github-perl/Changes
    trunk/libnet-github-perl/MANIFEST
    trunk/libnet-github-perl/META.yml
    trunk/libnet-github-perl/debian/changelog
    trunk/libnet-github-perl/debian/control
    trunk/libnet-github-perl/lib/Net/GitHub.pm
    trunk/libnet-github-perl/lib/Net/GitHub/V2/Issues.pm

Modified: trunk/libnet-github-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/Changes?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/Changes (original)
+++ trunk/libnet-github-perl/Changes Sun Mar  6 16:18:33 2011
@@ -1,4 +1,7 @@
 Revision history for Net-GitHub
+
+0.28    2011.03.06
+        use official GitHub API request instead of screen-scraping for 'comments' issues by spang (Christine Spang)
 
 0.27    2011.02.17
         requires HTTP::Request::Common; (RT 65787 by JQUELIN)

Modified: trunk/libnet-github-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/MANIFEST?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/MANIFEST (original)
+++ trunk/libnet-github-perl/MANIFEST Sun Mar  6 16:18:33 2011
@@ -52,6 +52,3 @@
 t/v1/mockdata/search.json
 t/v1/mockdata/single_commit.json
 t/v1/mockdata/user.json
-t/v2/70-issues-comments.t
-t/v2/mockdata/70-issues-comments.html
-t/v2/mockdata/70-issues-comments_zero.html

Modified: trunk/libnet-github-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/META.yml?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/META.yml (original)
+++ trunk/libnet-github-perl/META.yml Sun Mar  6 16:18:33 2011
@@ -34,4 +34,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/fayland/perl-net-github/tree/master
-version: 0.27
+version: 0.28

Modified: trunk/libnet-github-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/debian/changelog?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/debian/changelog (original)
+++ trunk/libnet-github-perl/debian/changelog Sun Mar  6 16:18:33 2011
@@ -1,3 +1,11 @@
+libnet-github-perl (0.28-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Bump debhelper to 8
+  * Add myself to Uploaders
+
+ -- Alessandro Ghedini <al3xbio at gmail.com>  Sun, 06 Mar 2011 17:15:02 +0100
+
 libnet-github-perl (0.27-1) unstable; urgency=low
 
   * New upstream release
@@ -51,7 +59,7 @@
 
   [ Angel Abad ]
   * New upstream release
-  * debian/control: 
+  * debian/control:
     - Add myself to uploaders
     - Add libtest-pod-perl to B-D-I
 

Modified: trunk/libnet-github-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/debian/control?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/debian/control (original)
+++ trunk/libnet-github-perl/debian/control Sun Mar  6 16:18:33 2011
@@ -1,7 +1,7 @@
 Source: libnet-github-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7.2.13)
+Build-Depends: debhelper (>= 8)
 Build-Depends-Indep: libany-moose-perl,
  libcrypt-ssleay-perl,
  libfile-slurp-perl,
@@ -16,7 +16,8 @@
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Christine Spang <christine at debian.org>,
  Angel Abad <angelabad at gmail.com>,
- Ansgar Burchardt <ansgar at debian.org>
+ Ansgar Burchardt <ansgar at debian.org>,
+ Alessandro Ghedini <al3xbio at gmail.com>
 Standards-Version: 3.9.1
 Homepage: http://search.cpan.org/dist/Net-GitHub/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnet-github-perl/

Modified: trunk/libnet-github-perl/lib/Net/GitHub.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/lib/Net/GitHub.pm?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/lib/Net/GitHub.pm (original)
+++ trunk/libnet-github-perl/lib/Net/GitHub.pm Sun Mar  6 16:18:33 2011
@@ -2,7 +2,7 @@
 
 use Any::Moose;
 
-our $VERSION = '0.27';
+our $VERSION = '0.28';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 sub new {

Modified: trunk/libnet-github-perl/lib/Net/GitHub/V2/Issues.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-github-perl/lib/Net/GitHub/V2/Issues.pm?rev=70705&op=diff
==============================================================================
--- trunk/libnet-github-perl/lib/Net/GitHub/V2/Issues.pm (original)
+++ trunk/libnet-github-perl/lib/Net/GitHub/V2/Issues.pm Sun Mar  6 16:18:33 2011
@@ -2,7 +2,7 @@
 
 use Any::Moose;
 
-our $VERSION = '0.18';
+our $VERSION = '0.28';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 with 'Net::GitHub::V2::HasRepo';
@@ -115,43 +115,11 @@
     my ( $self, $id ) = @_;
     my $owner   = $self->owner;
     my $repo    = $self->repo;
-    my $content = $self->get("http://github.com/$owner/$repo/issues#issue/$id");
-    require HTML::TreeBuilder;
-    my $tree = HTML::TreeBuilder->new;
-    $tree->parse_content($content);
-    $tree->elementify;
-    $tree = $tree->look_down( id => "issue_$id" );
-    return [] unless $tree;
-    my $comments_region = $tree->look_down( class => "comments commentstyle" );
-    if ($comments_region) {
-        my @comments_tree =
-          $comments_region->look_down( class => 'comment wikistyle' );
-        my @comments;
-        for my $c (@comments_tree) {
-            my ($id) = $c->attr('id') =~ /comment_(\d+)/;
-            my $meta    = $c->look_down( class => 'meta' );
-            my $author  = $meta->find_by_tag_name('b')->as_text;
-            my $date =
-              $meta->look_down( class => 'date' )
-              ->look_down( class => 'relatize' )->attr('title');
-            # hack $date to make it consistent with official api
-            $date =~ s!-!/!g;
-            $date .= ' -0700';
-
-            my $content = $c->look_down( class => 'body' )->as_text;
-            push @comments,
-              {
-                id      => $id,
-                author  => $author,
-                date    => $date,
-                content => $content,
-              };
-        }
-        return \@comments;
-    }
-    else {
-        return [];
-    }
+
+    my $url = "issues/comments/$owner/$repo/$id";
+    my $result = $self->get_json_to_obj( $url, 'comments');
+
+    return $result;
 }
 
 no Any::Moose;
@@ -257,18 +225,17 @@
 
 =item comments
 
-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',
+        id           => 12345,
+        gravatar_id  => 12345,
+        user         => 'foo',
+        created_at   => '2009/06/08 18:28:42 -0700',
+        modified_at  => '2009/06/08 18:28:42 -0700',
+        body         => 'blalba',
     }
 
 if no comments, return []




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