Changeset 27228 for lang/perl/plagger

Show
Ignore:
Timestamp:
12/22/08 19:39:38 (4 years ago)
Author:
otsune
Message:

opps. fix error

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/plagger/lib/Plagger/Plugin/Notify/ImKayac.pm

    r27215 r27228  
    33use base qw( Plagger::Plugin ); 
    44 
    5 use Encode; 
    65use Plagger::UserAgent; 
    76use HTTP::Request::Common; 
     
    1312    $context->register_hook( 
    1413        $self, 
    15         'plugin.init'      => \&initialize, 
    16         'publish.entry'    => \&notify_entry, 
     14        'plugin.init'   => \&initialize, 
     15        'publish.entry' => \&notify_entry, 
    1716    ); 
    1817} 
     
    5453        POST "http://im.kayac.com/api/post/$username", $post_body 
    5554    ); 
    56  
    5755    my $data = JSON::Syck::Load($res->content); 
    5856    if (ref $data ne 'HASH') { 
    59         $context->log(error => "json parse error: $data"); 
     57        $context->log(error => "json parse error: " . $res->content); 
    6058        return; 
    6159    } 
    6260    if ($data->{result} eq 'posted'){ 
    63         $context->log(debug => "Post entry success: $uri"); 
     61        $context->log(info  => "Post entry success: " . $args->{entry}->title ); 
    6462    } else { 
    65         $context->log(debug => "Post entry failed: @{[$data->{error}]}"); 
     63        $context->log(error => "Post entry failed: " . $data->{error} ); 
    6664    } 
    6765