summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-01-23 20:00:14 +0100
committerfranck cuny <franck@lumberjaph.net>2010-01-23 20:00:14 +0100
commitffebc3bb09cb6306892b7f8a3c3e023d1699de1b (patch)
treeb91d9a8c5b274a48b11d071354aeefce42bdedee
parentbasic github crawler using api (diff)
downloadgithub-explorer-ffebc3bb09cb6306892b7f8a3c3e023d1699de1b.tar.gz
tweaking and testing
-rw-r--r--lib/githubexplorer/Profile.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/githubexplorer/Profile.pm b/lib/githubexplorer/Profile.pm
index f580f79..d4024df 100644
--- a/lib/githubexplorer/Profile.pm
+++ b/lib/githubexplorer/Profile.pm
@@ -6,6 +6,7 @@ use Net::GitHub::V2::Users;
 sub fetch_profile {
     my ( $self, $login, $depth ) = @_;
 
+    return if $depth > 2;
     my $profile = $self->_profile_exists($login);
 
     say "fetch profile for $login ($depth)...";
@@ -28,9 +29,8 @@ sub fetch_profile {
     }
     my $followers   = $github->followers();
     my $local_depth = $depth + 1;
-    return $profile if $local_depth > 3;
     foreach my $f (@$followers) {
-        my $p = $self->fetch_profile( $f, $depth + 1 );
+        my $p = $self->fetch_profile( $f, $local_depth );
         next unless $p;
         $self->schema->resultset('Follow')
             ->create(