diff options
Diffstat (limited to 'lib/githubexplorer')
-rw-r--r-- | lib/githubexplorer/Gexf.pm | 52 | ||||
-rw-r--r-- | lib/githubexplorer/Repository.pm | 9 |
2 files changed, 55 insertions, 6 deletions
diff --git a/lib/githubexplorer/Gexf.pm b/lib/githubexplorer/Gexf.pm index 503eebe..c3be9dc 100644 --- a/lib/githubexplorer/Gexf.pm +++ b/lib/githubexplorer/Gexf.pm @@ -25,15 +25,55 @@ has graph => ( title => 'name' }, { - id => 1, + id => 1, + type => 'string', + title => 'type', + }, + { + id => 2, type => 'string', title => 'followers_count' }, { - id => 2, + id => 3, type => 'string', title => 'following_count' }, + { + id => 4, + type => 'string', + title => 'forks', + }, + { + id => 5, + type => 'string', + title => 'location', + }, + { + id => 6, + type => 'string', + title => 'public_gist_count', + }, + { + id => 7, + type => 'string', + title => 'public_repo_count', + }, + { + id => 8, + type => 'string', + title => 'language', + }, + { + id => 9, + type => 'string', + title => 'description', + }, + { + id => 10, + type => 'string', + title => 'watchers', + } ] } } @@ -78,4 +118,12 @@ sub profiles { return $xml_out; } +sub repositories { + my $self = shift; + my $repositories = $self->schema->resultset('Repositories')->search(); + + while (my $repo = $repositories->next) { + } +} + 1; diff --git a/lib/githubexplorer/Repository.pm b/lib/githubexplorer/Repository.pm index 035450a..617e091 100644 --- a/lib/githubexplorer/Repository.pm +++ b/lib/githubexplorer/Repository.pm @@ -2,6 +2,7 @@ package githubexplorer::Repository; use 5.010; use Moose::Role; use Net::GitHub::V2::Repositories; +use Try::Tiny; sub fetch_repositories { my ( $self, $profile ) = @_; @@ -14,9 +15,9 @@ sub fetch_repositories { my $repo_list = $github_profile->list(); - while ( ref $repo_list ne 'ARRAYREF' ) { + if ( ref $repo_list ne 'ARRAY' ) { sleep(60); - $repo_list = $github_profile->list(); + return; } foreach my $repos (@$repo_list) { @@ -40,9 +41,9 @@ sub fetch_repositories { token => $self->api_token, ); my $langs = $api_repos->languages; - while ( ref $langs ne 'HASHREF' ) { + if ( ref $langs ne 'HASH' ) { sleep(60); - $langs = $api_repos->languages; + next; } foreach my $lang ( keys %$langs ) { |