Changeset 9ae6095
- Timestamp:
- Jan 23, 2014, 6:24:58 PM (11 years ago)
- Branches:
- master, release-1.10
- Children:
- a2ae85a, 61ad0cb2, cba6b9c, 2e42098
- Parents:
- c53f5e8 (diff), 140429f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- perl/modules/Twitter/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm
rc53f5e8 r140429f 137 137 my $twitter_args = { username => $cfg->{user}, 138 138 password => $cfg->{password}, 139 source => 'barnowl', 139 source => 'barnowl', 140 140 ssl => 1, 141 legacy_lists_api => 0, 141 142 }; 142 143 if (defined $cfg->{service}) { … … 275 276 ); 276 277 278 BarnOwl::new_command( 'twitter-favorite' => sub { cmd_twitter_favorite(@_) }, 279 { 280 summary => 'Favorite the current Twitter message', 281 usage => 'twitter-favorite [ACCOUNT]', 282 description => <<END_DESCRIPTION 283 Favorite the current Twitter message using ACCOUNT (defaults to the 284 account that received the tweet). 285 END_DESCRIPTION 286 } 287 ); 288 277 289 BarnOwl::new_command( 'twitter-follow' => sub { cmd_twitter_follow(@_); }, 278 290 { … … 356 368 $account = $m->account unless defined($account); 357 369 find_account($account)->twitter_retweet($m); 370 return; 371 } 372 373 sub cmd_twitter_favorite { 374 my $cmd = shift; 375 my $account = shift; 376 my $m = BarnOwl::getcurmsg(); 377 if(!$m || $m->type ne 'Twitter') { 378 die("$cmd must be used with a Twitter message selected.\n"); 379 } 380 381 $account = $m->account unless defined($account); 382 find_account($account)->twitter_favorite($m); 358 383 return; 359 384 } -
perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm
r4ebbfbc r140429f 371 371 $self->twitter_direct($1, $2); 372 372 } elsif(defined $self->{twitter}) { 373 if(length($msg) > 140) {374 die("Twitter: Message over 140 characters long.\n");375 }376 373 $self->twitter_command('update', { 377 374 status => $msg, … … 432 429 } 433 430 431 sub twitter_favorite { 432 my $self = shift; 433 my $msg = shift; 434 435 if($msg->service ne $self->{cfg}->{service}) { 436 die("Cannot favorite a message from a different service.\n"); 437 } 438 $self->twitter_command(create_favorite => $msg->{status_id}); 439 } 440 441 434 442 sub twitter_follow { 435 443 my $self = shift;
Note: See TracChangeset
for help on using the changeset viewer.