Changeset 5d59c1e for perl/modules
- Timestamp:
- May 29, 2010, 1:42:02 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 2f25537
- Parents:
- d27ecf3
- git-author:
- Nelson Elhage <nelhage@mit.edu> (05/26/10 22:46:35)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/29/10 13:42:02)
- Location:
- perl/modules/Twitter/lib/BarnOwl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Twitter/lib/BarnOwl/Message/Twitter.pm
rf6413c3 r5d59c1e 17 17 sub service { return (shift->{"service"} || "http://twitter.com"); } 18 18 sub account { return shift->{"account"}; } 19 sub retweeted_by { shift->{retweeted_by}; } 19 20 sub long_sender { 20 21 my $self = shift; 21 22 $self->service =~ m#^\s*(.*?://.*?)/.*$#; 22 23 my $service = $1 || $self->service; 23 return $service . '/' . $self->sender 24 my $long = $service . '/' . $self->sender; 25 if ($self->retweeted_by) { 26 $long = "(retweeted by " . $self->retweeted_by . ") $long"; 27 } 28 return $long; 24 29 } 25 30 -
perl/modules/Twitter/lib/BarnOwl/Module/Twitter/Handle.pm
ra2640485 r5d59c1e 248 248 next; 249 249 } 250 my $orig = $tweet->{retweeted_status}; 251 $orig = $tweet unless defined($orig); 252 250 253 my $msg = BarnOwl::Message->new( 251 254 type => 'Twitter', 252 sender => $ tweet->{user}{screen_name},255 sender => $orig->{user}{screen_name}, 253 256 recipient => $self->{cfg}->{user} || $self->{user}, 254 257 direction => 'in', 255 source => decode_entities($ tweet->{source}),256 location => decode_entities($ tweet->{user}{location}||""),257 body => decode_entities($ tweet->{text}),258 source => decode_entities($orig->{source}), 259 location => decode_entities($orig->{user}{location}||""), 260 body => decode_entities($orig->{text}), 258 261 status_id => $tweet->{id}, 259 262 service => $self->{cfg}->{service}, 260 263 account => $self->{cfg}->{account_nickname}, 264 $tweet->{retweeted_status} ? (retweeted_by => $tweet->{user}{screen_name}) : () 261 265 ); 262 266 BarnOwl::queue_message($msg);
Note: See TracChangeset
for help on using the changeset viewer.