Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2009 07:16
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save miyagawa/101002 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Net::Google::Code;
use Net::GitHub;
use LWP::UserAgent;
use Text::CSV_XS;
my($gc_proj, $gh_proj) = @ARGV;
my %github;
@github{qw( owner repo )} = split '/', $gh_proj;
chomp($github{login} = `git config github.user`);
chomp($github{token} = `git config github.token`);
my $code = Net::Google::Code->new(project => $gc_proj);
my $github = Net::GitHub->new(%github);
for my $id (get_issues($code)) {
my $issue = $code->issue;
my $gh_issue = $github->issue->open($issue->summary, $issue->description);
warn "$id -> " . $gh_issue->{number};
sub get_issues {
my $ua = LWP::UserAgent->new;
my $content = $ua->get("$gc_proj/issues/csv")->content;
open my $io, '<', \$content;
my $parser = Text::CSV_XS->new({ binary => 1 });
my @issues;
while (my $row = $parser->getline_hr($io)) {
last unless $row->{ID};
push @issues, $row->{ID};
return @issues;
Copy link

Thank you very much for that. It helped! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment