otsune's SnakeOil RSSフィード

python -c "print''.join([chr(x) for x in 111&1101,110+~-~11,10^11*11,110+~-~11,-~101,-~11^11*11,~-110,111&11*11,11+11+10,11|~-0110,1-~11^11*11,10^11*11,-~11^11*11,110,101])"

2007-10-19

Publblish::LivedoorBookmarkの修正も適用した

| Publblish::LivedoorBookmarkの修正も適用した - otsune's SnakeOil  を含むブックマーク はてなブックマーク - Publblish::LivedoorBookmarkの修正も適用した - otsune's SnakeOil  Publblish::LivedoorBookmarkの修正も適用した - otsune's SnakeOil  のブックマークコメント

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の微修正も混じってるけど、それはそれ。

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

mattnmattn2007/10/19 18:57タグについてはも少し調べてから修正します。

mattnmattn2007/10/19 19:21もしかしたら逆かも。すみません。私の元のパッチから変ですね。
>||
($self->{mech}->form_name('clip') ? 'clip' : 'edit_form')
||<
申し訳ない。

otsuneotsune2007/10/19 22:54修正しました

トラックバック - http://subtech.g.hatena.ne.jp/otsune/20071019