Changeset 2226f91 for perl/modules/Facebook/lib/BarnOwl/Module
- Timestamp:
- Sep 19, 2011, 1:31:34 PM (13 years ago)
- Children:
- 61d7594
- Parents:
- 9da6022
- git-author:
- Edward Z. Yang <ezyang@mit.edu> (06/20/11 11:43:49)
- git-committer:
- Edward Z. Yang <ezyang@mit.edu> (09/19/11 13:31:34)
- Location:
- perl/modules/Facebook/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Facebook/lib/BarnOwl/Module/Facebook.pm
r9da6022 r2226f91 102 102 BarnOwl::new_command('facebook-comment' => \&cmd_facebook_comment, { 103 103 summary => 'Comment on a wall post.', 104 usage => 'facebook-comment POST ID',104 usage => 'facebook-comment POST_ID', 105 105 description => 'Comment on a friend\'s wall post. Using r is recommended.' 106 106 }); … … 130 130 sub cmd_facebook_comment { 131 131 my $cmd = shift; 132 my $post id = shift;132 my $post_id = shift; 133 133 134 my $topic = $facebook_handle->get_topic($post id);134 my $topic = $facebook_handle->get_topic($post_id); 135 135 136 136 # XXX UI should give some (better) indication /which/ conversation 137 137 # is being commented on 138 138 BarnOwl::start_edit_win("Write a comment on '$topic'...", 139 sub { $facebook_handle->facebook_comment($post id, shift) });139 sub { $facebook_handle->facebook_comment($post_id, shift) }); 140 140 } 141 141 -
perl/modules/Facebook/lib/BarnOwl/Module/Facebook/Handle.pm
r9da6022 r2226f91 179 179 my $name = $post->{to}{data}[0]{name} || $post->{from}{name}; 180 180 my $name_id = $post->{to}{data}[0]{id} || $post->{from}{id}; 181 my $post id = $post->{id};181 my $post_id = $post->{id}; 182 182 183 183 # Only handle post if it's new … … 186 186 my @keywords = keywords($post->{name} || $post->{message}); 187 187 my $topic = $keywords[0] || 'personal'; 188 $self->{topics}->{$post id} = $topic;188 $self->{topics}->{$post_id} = $topic; 189 189 # XXX indexing is fragile 190 190 my $msg = BarnOwl::Message->new( … … 196 196 direction => 'in', 197 197 body => $self->format_body($post), 198 post id => $postid,198 post_id => $post_id, 199 199 topic => $topic, 200 200 time => asctime(localtime $created_time), … … 206 206 BarnOwl::queue_message($msg); 207 207 } else { 208 $self->{topics}->{$post id} = $old_topics->{$postid} || 'personal';208 $self->{topics}->{$post_id} = $old_topics->{$post_id} || 'personal'; 209 209 } 210 210 … … 227 227 direction => 'in', 228 228 body => $comment->{message}, 229 post id => $postid,230 topic => $self->get_topic($post id),229 post_id => $post_id, 230 topic => $self->get_topic($post_id), 231 231 time => asctime(localtime $comment_time), 232 232 ); … … 279 279 my $self = shift; 280 280 281 my $post id = shift;281 my $post_id = shift; 282 282 my $msg = shift; 283 283 284 $self->{facebook}->add_comment( $post id )->set_message( $msg )->publish;284 $self->{facebook}->add_comment( $post_id )->set_message( $msg )->publish; 285 285 $self->sleep(0); 286 286 } … … 326 326 my $self = shift; 327 327 328 my $post id = shift;329 330 return $self->{topics}->{$post id} || 'personal';328 my $post_id = shift; 329 330 return $self->{topics}->{$post_id} || 'personal'; 331 331 } 332 332
Note: See TracChangeset
for help on using the changeset viewer.