Changeset 82e0f26 for lib/BarnOwl
- Timestamp:
- Aug 4, 2009, 1:30:08 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 513da71
- Parents:
- 5da6ed8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/BarnOwl/Module/Twitter/Handle.pm
r5da6ed8 r82e0f26 57 57 $self->{twitter} = Net::Twitter::Lite->new(%twitter_args); 58 58 59 my $timeline = $self->{twitter}->friends_timeline({count => 1}); 59 my $timeline = eval { $self->{twitter}->friends_timeline({count => 1}) }; 60 warn "$@" if $@; 60 61 61 62 if(!defined($timeline)) { … … 71 72 $self->{last_direct} = $self->{twitter}->direct_messages()->[0]{id}; 72 73 }; 74 warn "$@" if $@; 73 75 $self->{last_direct} = 1 unless defined($self->{last_direct}); 74 76 … … 76 78 $self->{twitter}->{ua}->timeout(1); 77 79 }; 80 warn "$@" if $@; 78 81 79 82 return $self; … … 83 86 my $self = shift; 84 87 85 my $ratelimit = $self->{twitter}->rate_limit_status; 88 my $ratelimit = eval { $self->{twitter}->rate_limit_status }; 89 warn "$@" if $@; 86 90 unless(defined($ratelimit) && ref($ratelimit) eq 'HASH') { 87 91 # Twitter's just sucking, sleep for 5 minutes … … 107 111 return unless BarnOwl::getvar('twitter:poll') eq 'on'; 108 112 109 my $timeline = $self->{twitter}->friends_timeline( { since_id => $self->{last_id} } ); 113 my $timeline = eval { $self->{twitter}->friends_timeline( { since_id => $self->{last_id} } ) }; 114 warn "$@" if $@; 110 115 unless(defined($timeline) && ref($timeline) eq 'ARRAY') { 111 116 $self->twitter_error(); … … 114 119 115 120 if ($self->{cfg}->{show_unsubscribed_replies}) { 116 my $mentions = $self->{twitter}->mentions( { since_id => $self->{last_id} } ); 121 my $mentions = eval { $self->{twitter}->mentions( { since_id => $self->{last_id} } ) }; 122 warn "$@" if $@; 117 123 unless (defined($mentions) && ref($mentions) eq 'ARRAY') { 118 124 $self->twitter_error(); … … 158 164 return unless BarnOwl::getvar('twitter:poll') eq 'on'; 159 165 160 my $direct = $self->{twitter}->direct_messages( { since_id => $self->{last_direct} } ); 166 my $direct = eval { $self->{twitter}->direct_messages( { since_id => $self->{last_direct} } ) }; 167 warn "$@" if $@; 161 168 unless(defined($direct) && ref($direct) eq 'ARRAY') { 162 169 $self->twitter_error();
Note: See TracChangeset
for help on using the changeset viewer.