Ignore:
Timestamp:
Jan 23, 2014, 6:24:58 PM (8 years ago)
Author:
Nelson Elhage <nelhage@nelhage.com>
Branches:
master
Children:
efaf2a6, 61ad0cb2, cba6b9c, 1972d6a, a2ae85a, 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.
Message:
Merge pull request #160 from nelhage/twitter

Some misc twitter fixes and improvements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm

    rc53f5e8 r140429f  
    137137        my $twitter_args = { username   => $cfg->{user},
    138138                             password   => $cfg->{password},
    139                              source     => 'barnowl', 
     139                             source     => 'barnowl',
    140140                             ssl        => 1,
     141                             legacy_lists_api => 0,
    141142                         };
    142143        if (defined $cfg->{service}) {
     
    275276);
    276277
     278BarnOwl::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
     283Favorite the current Twitter message using ACCOUNT (defaults to the
     284account that received the tweet).
     285END_DESCRIPTION
     286    }
     287);
     288
    277289BarnOwl::new_command( 'twitter-follow' => sub { cmd_twitter_follow(@_); },
    278290    {
     
    356368    $account = $m->account unless defined($account);
    357369    find_account($account)->twitter_retweet($m);
     370    return;
     371}
     372
     373sub 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);
    358383    return;
    359384}
Note: See TracChangeset for help on using the changeset viewer.