Changeset 27228 for lang/perl/plagger
- Timestamp:
- 12/22/08 19:39:38 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/plagger/lib/Plagger/Plugin/Notify/ImKayac.pm
r27215 r27228 3 3 use base qw( Plagger::Plugin ); 4 4 5 use Encode;6 5 use Plagger::UserAgent; 7 6 use HTTP::Request::Common; … … 13 12 $context->register_hook( 14 13 $self, 15 'plugin.init' => \&initialize,16 'publish.entry' => \¬ify_entry,14 'plugin.init' => \&initialize, 15 'publish.entry' => \¬ify_entry, 17 16 ); 18 17 } … … 54 53 POST "http://im.kayac.com/api/post/$username", $post_body 55 54 ); 56 57 55 my $data = JSON::Syck::Load($res->content); 58 56 if (ref $data ne 'HASH') { 59 $context->log(error => "json parse error: $data");57 $context->log(error => "json parse error: " . $res->content); 60 58 return; 61 59 } 62 60 if ($data->{result} eq 'posted'){ 63 $context->log( debug => "Post entry success: $uri");61 $context->log(info => "Post entry success: " . $args->{entry}->title ); 64 62 } else { 65 $context->log( debug => "Post entry failed: @{[$data->{error}]}");63 $context->log(error => "Post entry failed: " . $data->{error} ); 66 64 } 67 65
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)