Changeset 1625

Show
Ignore:
Timestamp:
08/25/05 15:24:57
Author:
miyagawa
Message:

no Hack

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bloglines2email/trunk/bloglines2email

    r1624 r1625  
    4848        Data => encode("utf-8", $body), 
    4949    ); 
    50     $msg->send("smtp", "monster.bulknews.net:10025", Timeout => 60) 
    51 
    52  
    53 sub hack_image { 
    54     ## this will break someday 
    55     my $feed = shift; 
    56     my $image = $feed->{image} or return; 
    57     my @stuff = grep length, map { s/^\s+//; $_ } split /\n/, $image; 
    58     return { 
    59         src  => $stuff[0], 
    60         href => $stuff[1], 
    61         alt  => $stuff[2], 
    62     }; 
     50    $msg->send("smtp", "localhost", Timeout => 60) 
    6351} 
    6452 
    6553sub format_body { 
    6654    my($feed, $item) = @_; 
    67     my $image = hack_image($feed); 
    6855    my $template = get_template(); 
    6956    my $tt = Template->new; 
     
    7158        feed => $feed, 
    7259        item => $item, 
    73         image => $image, 
    7460    }, \my $out); 
    7561    $out; 
     
    7965    return <<'HTML'; 
    8066<div> 
    81 [% IF image %]<div style="float:right"><a href="[% image.href %]"><img style="border:0" src="[% image.src | html %]" alt="[% image.alt | html %]" /></a></div>[% END %] 
     67[% IF feed.image %]<div style="float:right"><a href="[% feed.image.link %]"><img style="border:0" src="[% feed.image.url | html %]" alt="[% feed.image.title | html %]" /></a></div>[% END %] 
    8268<div>Link: <a href="[% item.link | html %]">[% item.link | html %]</a></div> 
    8369<div style="clear:both"></div>