Ignore:
Timestamp:
Aug 4, 2009, 2:23:28 AM (15 years ago)
Author:
Kevin Riggle <kevinr@free-dissociation.com>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
4bd9327
Parents:
82e0f26
Message:
Add :twitter-follow and :twitter-unfollow commands
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/BarnOwl/Module/Twitter/Handle.pm

    r82e0f26 r513da71  
    252252}
    253253
     254sub twitter_follow {
     255    my $self = shift;
     256
     257    my $who = shift;
     258
     259    my $user = $self->{twitter}->create_friend($who);
     260    # returns a string on error
     261    if (defined $user && !ref $user) {
     262        BarnOwl::message($user);
     263    } else {
     264        BarnOwl::message("Following " . $who);
     265    }
     266}
     267
     268sub twitter_unfollow {
     269    my $self = shift;
     270
     271    my $who = shift;
     272
     273    my $user = $self->{twitter}->destroy_friend($who);
     274    # returns a string on error
     275    if (defined $user && !ref $user) {
     276        BarnOwl::message($user);
     277    } else {
     278        BarnOwl::message("No longer following " . $who);
     279    }
     280}
     281
    2542821;
Note: See TracChangeset for help on using the changeset viewer.