Changeset 16821 for lang/perl/plagger

Show
Ignore:
Timestamp:
07/30/08 07:40:33 (4 months ago)
Author:
hsbt
Message:

add channel_update and templatize.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/plagger/lib/Plagger/Plugin/Publish/Wassr.pm

    r1182 r16821  
    3232 
    3333    my $body = $self->templatize('wassr.tt', $args); 
     34    unless ($self->conf->{templatize}) { 
     35        $body = $args->{entry}->body_text; 
     36    } 
     37 
    3438    # TODO: FIX when Summary configurable. 
    3539    if ( length($body) > 159 ) { 
     
    3741    } 
    3842    $context->log(info => "Updating Wassr status to '$body'"); 
    39     $self->{wassr}->update( {status => encode_utf8($body)} ) or $context->error("Can't update wassr status"); 
    40  
     43    if ($self->conf->{channel}) { 
     44        $self->{wassr}->channel_update( {name_en => $self->conf->{channel}, body => encode_utf8($body)} ) or $context->error("Can't update wassr status"); 
     45    } else { 
     46        $self->{wassr}->update( {status => encode_utf8($body)} ) or $context->error("Can't update wassr status"); 
     47    } 
    4148    my $sleeping_time = $self->conf->{interval} || 15; 
    4249    $context->log(info => "sleep $sleeping_time."); 
     
    5764      username: wassr-id 
    5865      password: wassr-password 
     66      channel: name_en 
     67      templatize: 1 
    5968 
    6069=head1 DESCRIPTION