X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/6339ff1d9c92a092fd03b14a86fbe3dac7a43b89..2b71a7777141bcc9a4c1681f899d2b86696790b4:/twirssi.pl diff --git a/twirssi.pl b/twirssi.pl index 83f1fe0..a7f8c4d 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -9,8 +9,8 @@ use File::Temp; use vars qw($VERSION %IRSSI); use constant { DEBUG => 0 }; -$VERSION = "1.1"; -my ($REV) = '$Rev: 309 $' =~ /(\d+)/; +$VERSION = "1.2"; +my ($REV) = '$Rev: 310 $' =~ /(\d+)/; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -231,12 +231,19 @@ sub cmd_login { } if ($twit) { + my $rate_limit = $twit->rate_limit_status(); + if ( $rate_limit and $rate_limit->{remaining_hits} < 1 ) { + ¬ice("Rate limit exceeded, try again later"); + $twit = undef; + return; + } + $twits{$user} = $twit; Irssi::timeout_remove($poll) if $poll; $poll = Irssi::timeout_add( 300 * 1000, \&get_updates, "" ); ¬ice("Logged in as $user, loading friends list..."); &load_friends; - ¬ice( "loaded friends: ", scalar keys %nicks ); + ¬ice( "loaded friends: ", scalar keys %friends ); %nicks = %friends; $nicks{$user} = 0; &get_updates;