- Timestamp:
- Mar 25, 2010, 12:48:01 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 4225627
- Parents:
- 6249a76d
- git-author:
- Kevin Riggle <kevinr@free-dissociation.com> (03/07/10 01:52:58)
- git-committer:
- Nelson Elhage <nelhage@ksplice.com> (03/25/10 12:48:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/BarnOwl/Module/Twitter/Handle.pm
rbdb7c26 r538a5f7 281 281 } 282 282 283 sub _stripnl { 284 my $msg = shift; 285 286 # strip non-newline whitespace around newlines 287 $msg =~ s/[^\n\S]*(\n+)[^\n\S]*/$1/sg; 288 # change single newlines to a single space; leave multiple newlines 289 $msg =~ s/([^\n])\n([^\n])/$1 $2/sg; 290 # strip leading and trailing whitespace 291 $msg =~ s/\s+$//s; 292 $msg =~ s/^\s+//s; 293 294 return $msg; 295 } 296 283 297 sub twitter { 284 298 my $self = shift; 285 299 286 my $msg = shift;300 my $msg = _stripnl(shift); 287 301 my $reply_to = shift; 288 302 … … 305 319 306 320 my $who = shift; 307 my $msg = shift; 321 my $msg = _stripnl(shift); 322 308 323 if(defined $self->{twitter}) { 309 324 $self->twitter_command('new_direct_message', {
Note: See TracChangeset
for help on using the changeset viewer.