Changeset 6c3d4ad for perl/modules
- Timestamp:
- Jun 22, 2011, 9:56:46 PM (13 years ago)
- 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)
- Location:
- perl/modules/Facebook
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Facebook/README
rf4d1717 r6c3d4ad 32 32 and blocks the entire BarnOwl interface. We need to confront 33 33 Perl's threading demon. 34 * Need to detect if you have two friends with the same name and 35 disambiguate if so. 34 36 * No messaging support. 35 37 * No auto-completion support. -
perl/modules/Facebook/lib/BarnOwl/Message/Facebook.pm
rf4d1717 r6c3d4ad 22 22 # TODO: Support for direct messages 23 23 # XXX: It seems that Facebook may not support this yet 24 return BarnOwl::quote('facebook-comment', $self->{post id});24 return BarnOwl::quote('facebook-comment', $self->{post_id}); 25 25 } 26 26 … … 35 35 # XXX I hope $filter isn't used for anything besides display purposes 36 36 if($inst) { 37 $filter = "facebook: " . $self->{name} . " " . $self->{post id};37 $filter = "facebook: " . $self->{name} . " " . $self->{post_id}; 38 38 BarnOwl::command("filter", $filter, 39 39 qw{type ^facebook$ and name_id}, '^'.$self->{name_id}.'$', 40 qw{and post id}, '^'.$self->{postid}.'$');40 qw{and post_id}, '^'.$self->{post_id}.'$'); 41 41 } else { 42 42 $filter = "facebook: " . $self->{name}; -
perl/modules/Facebook/lib/BarnOwl/Module/Facebook.pm
rf4d1717 r6c3d4ad 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
rf4d1717 r6c3d4ad 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.