Index: lib/BarnOwl/Module/Twitter.pm
===================================================================
--- lib/BarnOwl/Module/Twitter.pm	(revision 176434d985ab3cd0ecff30b94e805527b7fba3e3)
+++ lib/BarnOwl/Module/Twitter.pm	(revision 36546fa4ddc4de9c607b0f7bb76f8041360cf9f1)
@@ -187,14 +187,4 @@
 }
 
-sub poll_messages {
-    return unless @twitter_handles;
-
-    my $handle = $twitter_handles[$next_service_to_poll];
-    $next_service_to_poll = ($next_service_to_poll + 1) % scalar(@twitter_handles);
-    
-    $handle->poll_twitter() if $handle->{cfg}->{poll_for_tweets};
-    $handle->poll_direct() if $handle->{cfg}->{poll_for_dms};
-}
-
 sub find_account {
     my $name = shift;
@@ -322,13 +312,4 @@
 }
 
-eval {
-    $BarnOwl::Hooks::receiveMessage->add("BarnOwl::Module::Twitter::handle_message");
-    $BarnOwl::Hooks::mainLoop->add("BarnOwl::Module::Twitter::poll_messages");
-};
-if($@) {
-    $BarnOwl::Hooks::receiveMessage->add(\&handle_message);
-    $BarnOwl::Hooks::mainLoop->add(\&poll_messages);
-}
-
 BarnOwl::filter(qw{twitter type ^twitter$});
 
Index: lib/BarnOwl/Module/Twitter/Handle.pm
===================================================================
--- lib/BarnOwl/Module/Twitter/Handle.pm	(revision 26f9e2e8f6e584cb37780c6ec9bfc4dbd4b3ae65)
+++ lib/BarnOwl/Module/Twitter/Handle.pm	(revision 36546fa4ddc4de9c607b0f7bb76f8041360cf9f1)
@@ -57,8 +57,8 @@
         'cfg'  => $cfg,
         'twitter' => undef,
-        'last_poll' => 0,
-        'last_direct_poll' => 0,
         'last_id' => undef,
         'last_direct' => undef,
+        'timer'        => undef,
+        'direct_timer' => undef
     };
 
@@ -92,7 +92,36 @@
     warn "$@" if $@;
 
+    $self->sleep(0);
+
     return $self;
 }
 
+=head2 sleep SECONDS
+
+Stop polling Twitter for SECONDS seconds.
+
+=cut
+
+sub sleep {
+    my $self  = shift;
+    my $delay = shift;
+
+    if($self->{cfg}->{poll_for_tweets}) {
+        $self->{timer} = BarnOwl::Timer->new({
+            after    => $delay,
+            interval => 60,
+            cb       => sub { $self->poll_twitter }
+           });
+    }
+
+    if($self->{cfg}->{poll_for_dms}) {
+        $self->{direct_timer} = BarnOwl::Timer->new({
+            after    => $delay,
+            interval => 120,
+            cb       => sub { $self->poll_direct }
+           });
+    }
+}
+
 sub twitter_error {
     my $self = shift;
@@ -101,16 +130,16 @@
     warn "$@" if $@;
     unless(defined($ratelimit) && ref($ratelimit) eq 'HASH') {
-        # Twitter's just sucking, sleep for 5 minutes
-        $self->{last_direct_poll} = $self->{last_poll} = time + 60*5;
-        # die("Twitter seems to be having problems.\n");
+        # Twitter's probably just sucking, try again later.
+        $self->sleep(5);
         return;
     }
+
     if(exists($ratelimit->{remaining_hits})
        && $ratelimit->{remaining_hits} <= 0) {
-        $self->{last_direct_poll} = $self->{last_poll} = $ratelimit->{reset_time_in_seconds};
+        $self->sleep(time - $ratelimit->{reset_time_in_seconds} + 60);
         die("Twitter: ratelimited until " . $ratelimit->{reset_time} . "\n");
     } elsif(exists($ratelimit->{error})) {
+        $self->sleep(60*20);
         die("Twitter: ". $ratelimit->{error} . "\n");
-        $self->{last_direct_poll} = $self->{last_poll} = time + 60*20;
     }
 }
@@ -119,7 +148,7 @@
     my $self = shift;
 
-    return unless ( time - $self->{last_poll} ) >= 60;
-    $self->{last_poll} = time;
     return unless BarnOwl::getvar('twitter:poll') eq 'on';
+
+    BarnOwl::debug("Polling " . $self->{cfg}->{account_nickname});
 
     my $timeline = eval { $self->{twitter}->friends_timeline( { since_id => $self->{last_id} } ) };
@@ -172,7 +201,7 @@
     my $self = shift;
 
-    return unless ( time - $self->{last_direct_poll}) >= 120;
-    $self->{last_direct_poll} = time;
     return unless BarnOwl::getvar('twitter:poll') eq 'on';
+
+    BarnOwl::debug("Polling direct for " . $self->{cfg}->{account_nickname});
 
     my $direct = eval { $self->{twitter}->direct_messages( { since_id => $self->{last_direct} } ) };
