2007-10-19
Publblish::LivedoorBookmarkの修正も適用した
plagger |
![]()
Sbox Errorの指摘をうけて修正。
=== lib/Plagger/Plugin/Publish/LivedoorClip.pm ================================================================== --- lib/Plagger/Plugin/Publish/LivedoorClip.pm (revision 2541) +++ lib/Plagger/Plugin/Publish/LivedoorClip.pm (local) @@ -46,19 +46,25 @@ tags => encode('utf-8', $tag_string), title => encode('utf-8', $args->{entry}->title), notes => $summary, + rate => ($args->{entry}->rate || $self->conf->{default_rate} || 1), ); my $add_url = $uri->as_string; my $res = eval { $self->{mech}->get($add_url) }; if ($res && $res->is_success) { - eval { $self->{mech}->submit_form(form_name => 'clip') }; + eval { + $self->{mech}->submit_form( + form_name => + ($self->{mech}->form_name('clip') ? 'clip' : 'edit_form' ) + ); + }; if ($@) { - $context->log(info => "can't submit: " . $args->{entry}->link); + $context->log(info => "can't submit: $@ at $args->{entry}->link"); } else { $context->log(info => "Post entry success."); } } else { - $context->log(info => "fail to clip $add_url HTTP Status: " . $res->code); + $context->log(error => "fail to clip $add_url HTTP Status: $res->code"); } my $sleeping_time = $self->conf->{interval} || 3; @@ -114,6 +120,7 @@ password: your-password interval: 2 post_body: 1 + default_rate: 1 =head1 DESCRIPTION @@ -124,6 +131,7 @@ =head1 AUTHOR Kazuhiro Osawa, Koichi Taniguchi +Yasuhiro Matsumoto =head1 SEE ALSO
なんかcontent logの微修正も混じってるけど、それはそれ。
トラックバック - http://subtech.g.hatena.ne.jp/otsune/20071019

($self->{mech}->form_name('clip') ? 'edit_form' : 'clip' ;)
||<
の";"が要らないかもしれません。
>||
($self->{mech}->form_name('clip') ? 'clip' : 'edit_form')
||<
申し訳ない。