Skip to content

Commit

Permalink
Remove unused autofollow() subroutine.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jul 20, 2013
1 parent 1060c9c commit bb9552b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -48,62 +48,6 @@
{binmode => ':utf8'})
or die $tt->error;

sub autofollow {
my $t = shift;

my %follow;

for (my $cur = -1, my $r; $cur; $cur = $r->{next_cursor}) {
$r = $t->friends({cursor => $cur});

foreach (@{$r->{users}}) {
$follow{$_->{screen_name}} = 1;
}
}

# unless ($follow) {
# warn scalar localtime() . "\n";
# warn $t->http_message . "\n";
# warn $t->{_twitter_error}{error} . "\n";
# return;
# }

my %nofollow;
if (-e 'nofollow') {
open my $nf, '<', 'nofollow' or die $!;
while (<$nf>) {
chomp;
s/\s+//;
$nofollow{$_} = 1;

if ($follow{$_}) {
$t->destroy_friend($_);
delete $follow{$_};
}
}
}

my %followers;

for (my $cur = -1, my $r; $cur; $cur = $r->{next_cursor}) {
$r = $t->followers({cursor => $cur});

foreach (@{$r->{users}}) {
unless ($nofollow{$_->{screen_name}} or $follow{$_->{screen_name}}) {
if ($_->{protected}) {
warn "Protected user $_->{screen_name} following\n";
warn "Not following back\n";
next;
}
$t->create_friend($_->{screen_name});
$follow{$_->{screen_name}} = 1;
}
}
}

return \%follow;
}

sub get_twitter_authorization {
print "Visit the following URL in your browser to authorize this app:\n" .
$t->get_authorization_url() . "\n";
Expand Down
Empty file modified index.tt
100644 → 100755
Empty file.

0 comments on commit bb9552b

Please sign in to comment.