Changeset 2c4c4c4
- Timestamp:
- Jun 22, 2011, 9:56:47 PM (13 years ago)
- Children:
- 2f6c263
- Parents:
- 68fa539
- git-author:
- Edward Z. Yang <ezyang@mit.edu> (06/22/11 18:42:02)
- git-committer:
- Edward Z. Yang <ezyang@mit.edu> (06/22/11 21:56:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Facebook/lib/BarnOwl/Module/Facebook/Handle.pm
r68fa539 r2c4c4c4 270 270 my $post_id = $post->{id}; 271 271 272 # Only handle post if it's new273 my $created_time = str2time($post->{created_time});274 if ($created_time >= $self->{last_poll}){272 if (defined $old_topics->{$post_id}) { 273 $self->{topics}->{$post_id} = $old_topics->{$post_id}; 274 } else { 275 275 my @keywords = keywords($post->{name} || $post->{message}); 276 276 my $topic = $keywords[0] || 'personal'; 277 277 $topic =~ s/ /-/g; 278 278 $self->{topics}->{$post_id} = $topic; 279 } 280 281 # Only handle post if it's new 282 my $created_time = str2time($post->{created_time}); 283 if ($created_time >= $self->{last_poll}) { 279 284 # XXX indexing is fragile 280 285 my $msg = BarnOwl::Message->new( … … 286 291 direction => 'in', 287 292 body => $self->format_body($post), 288 post_id 289 topic => $ topic,293 post_id => $post_id, 294 topic => $self->get_topic($post_id), 290 295 time => asctime(localtime $created_time), 291 296 # XXX The intent is to get the 'Comment' link, which also … … 295 300 ); 296 301 BarnOwl::queue_message($msg); 297 } else {298 $self->{topics}->{$post_id} = $old_topics->{$post_id} || 'personal';299 302 } 300 303
Note: See TracChangeset
for help on using the changeset viewer.