Changeset 1631

Show
Ignore:
Timestamp:
08/26/05 15:17:07
Author:
miyagawa
Message:

packaging stuff
CSS fix
--test option for testing (don't mark read on Bloglines API)

Files:

Legend:

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

    r1626 r1631  
    11#!/usr/local/bin/perl -w 
    22use strict; 
    3 use Digest::SHA1 qw(sha1_hex); 
    43use Encode; 
    54use FindBin; 
    65use File::Spec; 
     6use Getopt::Long; 
    77use MIME::Lite; 
    88use Template; 
    99use WebService::Bloglines; 
    1010use YAML; 
     11 
     12our $VERSION = '0.01'; 
     13 
     14GetOptions("test", \my $testmode); 
    1115 
    1216my $conf = File::Spec->catfile($FindBin::Bin, "bloglines2email.conf"); 
     
    1822); 
    1923 
    20 my @updates = $bws->getitems(0, 1); 
     24my $mark_read = $testmode ? 0 : 1; 
     25my @updates = $bws->getitems(0, $mark_read); 
    2126for my $update (@updates) { 
    2227    send_email($cfg, $update); 
     
    3742       $feed_title =~ tr/,/;/; 
    3843    my $msg = MIME::Lite->new( 
    39         From => encode('MIME-Header', "$feed_title <$cfg->{mailfrom}>"), 
     44        From => encode('MIME-Header', qq("$feed_title" <$cfg->{mailfrom}>)), 
    4045        To   => $cfg->{mailto}, 
    4146        Subject => encode('MIME-Header', $item->{title}), 
     
    6570<div> 
    6671[% 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 %] 
    67 <div>Link: <a href="[% item.link | html %]">[% item.link | html %]</a></div> 
     72<div>Link: <a href="[% item.link | html %]">[% item.link | html %]</a><br /> 
     73[% IF item.dc.creator %]by [% item.dc.creator | html %][% END %][% IF item.dc.subject %] on [% item.dc.subject %][% END %]</div> 
    6874<div style="clear:both"></div> 
    69 <div style="font-size:0.8em">[% IF item.creator %]by [% item.creator | html %][% END %][% IF item.dc.subject %] on [% item.dc.subject %][% END %]</div> 
    70 <div style="padding: 1.2em">[% item.description %]</div> 
     75<div style="padding: 1em 0">[% item.description %]</div> 
    7176<div style="font-size:0.8em">[% IF item.pubDate %]Posted on [% item.pubDate %][% END %] | <a href="[% item.link | html %]">permalink</a> | <a href="[% feed.link | html %]">[% feed.title | html %]</a></div> 
     77</div> 
    7278HTML 
    7379}