Changeset 6c3d4ad for perl/modules


Ignore:
Timestamp:
Jun 22, 2011, 9:56:46 PM (13 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Children:
303dbc1
Parents:
f4d1717
git-author:
Edward Z. Yang <ezyang@mit.edu> (06/20/11 11:43:49)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (06/22/11 21:56:46)
Message:
Rename postid to post_id.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Location:
perl/modules/Facebook
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Facebook/README

    rf4d1717 r6c3d4ad  
    3232    and blocks the entire BarnOwl interface.  We need to confront
    3333    Perl's threading demon.
     34  * Need to detect if you have two friends with the same name and
     35    disambiguate if so.
    3436  * No messaging support.
    3537  * No auto-completion support.
  • perl/modules/Facebook/lib/BarnOwl/Message/Facebook.pm

    rf4d1717 r6c3d4ad  
    2222    # TODO: Support for direct messages
    2323    # XXX: It seems that Facebook may not support this yet
    24     return BarnOwl::quote('facebook-comment', $self->{postid});
     24    return BarnOwl::quote('facebook-comment', $self->{post_id});
    2525}
    2626
     
    3535    # XXX I hope $filter isn't used for anything besides display purposes
    3636    if($inst) {
    37         $filter = "facebook: " . $self->{name} . " " . $self->{postid};
     37        $filter = "facebook: " . $self->{name} . " " . $self->{post_id};
    3838        BarnOwl::command("filter", $filter,
    3939                         qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$',
    40                          qw{and postid}, '^'.$self->{postid}.'$');
     40                         qw{and post_id}, '^'.$self->{post_id}.'$');
    4141    } else {
    4242        $filter = "facebook: " . $self->{name};
  • perl/modules/Facebook/lib/BarnOwl/Module/Facebook.pm

    rf4d1717 r6c3d4ad  
    102102BarnOwl::new_command('facebook-comment' => \&cmd_facebook_comment, {
    103103    summary     => 'Comment on a wall post.',
    104     usage       => 'facebook-comment POSTID',
     104    usage       => 'facebook-comment POST_ID',
    105105    description => 'Comment on a friend\'s wall post.  Using r is recommended.'
    106106});
     
    130130sub cmd_facebook_comment {
    131131    my $cmd  = shift;
    132     my $postid = shift;
     132    my $post_id = shift;
    133133
    134     my $topic = $facebook_handle->get_topic($postid);
     134    my $topic = $facebook_handle->get_topic($post_id);
    135135
    136136    # XXX UI should give some (better) indication /which/ conversation
    137137    # is being commented on
    138138    BarnOwl::start_edit_win("Write a comment on '$topic'...",
    139                             sub { $facebook_handle->facebook_comment($postid, shift) });
     139                            sub { $facebook_handle->facebook_comment($post_id, shift) });
    140140}
    141141
  • perl/modules/Facebook/lib/BarnOwl/Module/Facebook/Handle.pm

    rf4d1717 r6c3d4ad  
    179179        my $name    = $post->{to}{data}[0]{name} || $post->{from}{name};
    180180        my $name_id = $post->{to}{data}[0]{id} || $post->{from}{id};
    181         my $postid  = $post->{id};
     181        my $post_id  = $post->{id};
    182182
    183183        # Only handle post if it's new
     
    186186            my @keywords = keywords($post->{name} || $post->{message});
    187187            my $topic = $keywords[0] || 'personal';
    188             $self->{topics}->{$postid} = $topic;
     188            $self->{topics}->{$post_id} = $topic;
    189189            # XXX indexing is fragile
    190190            my $msg = BarnOwl::Message->new(
     
    196196                direction => 'in',
    197197                body      => $self->format_body($post),
    198                 postid    => $postid,
     198                post_id    => $post_id,
    199199                topic     => $topic,
    200200                time      => asctime(localtime $created_time),
     
    206206            BarnOwl::queue_message($msg);
    207207        } else {
    208             $self->{topics}->{$postid} = $old_topics->{$postid} || 'personal';
     208            $self->{topics}->{$post_id} = $old_topics->{$post_id} || 'personal';
    209209        }
    210210
     
    227227                    direction => 'in',
    228228                    body      => $comment->{message},
    229                     postid    => $postid,
    230                     topic     => $self->get_topic($postid),
     229                    post_id    => $post_id,
     230                    topic     => $self->get_topic($post_id),
    231231                    time      => asctime(localtime $comment_time),
    232232                   );
     
    279279    my $self = shift;
    280280
    281     my $postid = shift;
     281    my $post_id = shift;
    282282    my $msg = shift;
    283283
    284     $self->{facebook}->add_comment( $postid )->set_message( $msg )->publish;
     284    $self->{facebook}->add_comment( $post_id )->set_message( $msg )->publish;
    285285    $self->sleep(0);
    286286}
     
    326326    my $self = shift;
    327327
    328     my $postid = shift;
    329 
    330     return $self->{topics}->{$postid} || 'personal';
     328    my $post_id = shift;
     329
     330    return $self->{topics}->{$post_id} || 'personal';
    331331}
    332332
Note: See TracChangeset for help on using the changeset viewer.