Changeset 1944
- Timestamp:
- 04/22/07 23:23:54
- Files:
-
- trunk/plagger (modified) (previous)
- trunk/plagger/assets/plugins/Publish-Twitter (added)
- trunk/plagger/assets/plugins/Publish-Twitter/twitter.tt (added)
- trunk/plagger/lib/Plagger/Plugin/Publish/Twitter.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Publish/Twitter.pm
r1943 r1944 5 5 use Encode; 6 6 use Net::Twitter; 7 use Time::HiRes qw(sleep); 7 8 8 9 sub register { … … 30 31 my($self, $context, $args) = @_; 31 32 32 my $body = ( $args->{entry}->summary->plaintext || $args->{entry}->title ) . " " . $args->{entry}->permalink;33 my $body = $self->templatize('twitter.tt', $args); 33 34 # TODO: FIX when Summary configurable. 34 35 if ( length($body) > 159 ) { … … 37 38 $context->log(info => "Updating Twitter status to '$body'"); 38 39 $self->{twitter}->update( encode_utf8($body) ) or $context->error("Can't update twitter status"); 40 41 my $sleeping_time = $self->conf->{interval} || 15; 42 $context->log(info => "sleep $sleeping_time."); 43 sleep( $sleeping_time ); 39 44 } 40 45 … … 69 74 Twitter password. Required. 70 75 76 =item interval 77 78 Optional. 79 71 80 =item apiurl 72 81
