perl な記事たち

Abstract

LoveVector の、タグ perl に関係のある記事群です。

PlaggerLDR で無理やり icon を表示する patch

URI
http://okowa.org/vector/2006/05/20/patch-pldr-icon
Created
2006-05-20T20:39:53+09:00
Tags
Writebacks
「PlaggerLDR で無理やり icon を表示する patch」への Comments: 6 / 「PlaggerLDR で無理やり icon を表示する patch」への Trackbacks: 0

いまの PlaggerLDR は icon がつかなくて mixi とかが悲しいので。

Index: lib/Plagger/Plugin/Store/DBIC.pm
===================================================================
--- lib/Plagger/Plugin/Store/DBIC.pm    (revision 789)
+++ lib/Plagger/Plugin/Store/DBIC.pm    (working copy)
@@ -103,10 +103,15 @@
             link => $feed_entry->link,
         });

-        for my $attr (qw/title author summary date body rate/) {    # todo: icon
+        for my $attr (qw/title author summary date rate/) {    # todo: restruct
             $entry->$attr( $feed_entry->$attr )
                 if defined $feed_entry->$attr && (!$entry->$attr or $entry->$attr ne $feed_entry->$attr);
         }
+        if (defined $feed_entry->body) {
+            my $tt = $c->template;
+            $tt->process('dbic_notify.tt', { entry => $feed_entry }, \my $body) or $c->error($tt->error);
+            $entry->body($body) if !$entry->body or $entry->body ne $body;
+        }
         $entry->insert_or_update if $entry->is_changed;

         # meta

assets/plugins/Store-DBIC/dbic_notify.tt:

<div>
[% USE util = Plagger.Util -%]
[% IF entry.icon %]<div><img [% util.dumbnail(entry.icon, width=150, height=60) %] align="right" src="[% entry.icon.url | html %]" alt="" /></div>
[% END -%]
[% IF entry.body.match('(?i)^<p[ >]') %][% entry.body %][% ELSE %]<div style="padding: 1em 0">[% entry.body %]</div>[% END %]
</div>

スキーマを変えて PlaggerLDR 側でやるのが正攻法だと思うけど,面倒なのでとりあえずこれで。

良く考えたらこれ Filter:: 書くべきだったかな。まぁいいや。

Catalyst の Changes にゾロ目が多い件

URI
http://okowa.org/vector/2005/11/17/catalyst-modified-date
Created
2005-11-17T15:38:24+09:00
Tags
Writebacks
「Catalyst の Changes にゾロ目が多い件」への Comments: 0 / 「Catalyst の Changes にゾロ目が多い件」への Trackbacks: 0
5.56   2005-11-16 10:33:00
        - Fixed FastCGI engine to not clobber the global %ENV on each
          request. (Sam Vilain)
        - Updated benchmarking to work with detach
        - Fixed dispatcher, so $c->req->action(undef) works again
        - Updated Catalyst::Test to use HTTP::Request::AsCGI
        - Added -pidfile to external FastCGI server.

5.55    2005-11-15 12:55:00
        - Fixed multiple cookie handling

5.54    2005-11-14 22:55:00
        - Fixed a Module::Pluggable::Fast related bug

5.53    2005-11-14 15:55:00
        - Removed t/04prereq.t that was testing for non-required
          modules.

なんでこんなゾロ目時刻(というか 55 分)ばっかりなの?

Topic Path

  1. okowa.org
  2. LoveVector
  3. perl
Last-Modified
2010-07-31T07:08:32+09:00
Feeds
Recent Updates (RSS 1.0)
Powered by
XML::LibXSLT / format.xsl / Movable Type 3.31-ja
LoveVector : klm <klm at okowa dot org>