Changeset 1650

Show
Ignore:
Timestamp:
09/09/05 05:16:24
Author:
miyagawa
Message:

Added mailroute option
Added documentation and Changes file for the release

Files:

Legend:

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

    • Property svn:keywords set to Id Revision
    r1649 r1650  
    11#!/usr/local/bin/perl -w 
     2# $Id$ 
    23use strict; 
    34use DateTime; 
     
    1213use YAML; 
    1314 
    14 our $VERSION = '0.01'; 
     15our $VERSION = '0.10'; 
    1516 
    1617GetOptions(\our %opt, "test", "verbose", "conf=s"); 
     
    2324    password => $cfg->{password}, 
    2425); 
     26 
     27setup_mailroute($cfg); 
    2528 
    2629my $mark_read = $opt{test} ? 0 : 1; 
     
    2932for my $update (@updates) { 
    3033    send_email($cfg, $update); 
     34} 
     35 
     36sub setup_mailroute { 
     37    my $cfg = shift; 
     38    my $route = $cfg->{mailroute} || { via => 'smtp', host => 'localhost' }; 
     39    my @args  = $route->{host} ? ($route->{host}) : (); 
     40    MIME::Lite->send($route->{via}, @args); 
    3141} 
    3242 
     
    128138bloglines2email - Send Bloglines unread items as HTML mail 
    129139 
     140=head1 SYNOPSIS 
     141 
     142  % bloglines2email 
     143  % bloglines2email --conf=/path/to/bloglines2email.conf --test --verbose 
     144 
     145=head1 DESCRIPTION 
     146 
     147C<bloglines2email> is a command line application that fetches 
     148Bloglines unread items via Bloglines Web Services and sends them as 
     149HTML mail to your address (Gmail is preferrable). It gives you an easy 
     150way to manage, browse and search Blog entries rather than using 
     151Bloglines interface directly. 
     152 
     153You'd better run this app by crontab like every 5 minutes. 
     154 
     155=head1 REQUIREMENT 
     156 
     157This app requires perl 5.8.0 with following Perl modules installed on your box. 
     158 
     159=over 4 
     160 
     161=item DateTime 
     162 
     163=item DateTime::Format::Mail 
     164 
     165=item MIME::Lite 
     166 
     167=item Template 
     168 
     169=item WebService::Bloglines 
     170 
     171=item YAML 
     172 
     173=back 
     174 
     175=head1 OPTIONS 
     176 
     177This application has following command line options. 
     178 
     179=over 4 
     180 
     181=item --test 
     182 
     183Doesn't mark unread items as read. Default: mark read. 
     184 
     185=item --verbose 
     186 
     187Gives diagnostic messages to STDERR. Default: no verbose. 
     188 
     189=item --conf 
     190 
     191Specifies a path of configuration YAML file. Default: 
     192C<bloglines2email.conf> in the same directory as script. 
     193 
     194=back 
     195 
     196=head1 CONFIGURATION 
     197 
     198This app uses C<bloglines2email.conf> that sits beside the script in 
     199the same directory (or you can specify the file path using C<--conf> 
     200option). The distribution has a sample configuration file named 
     201C<bloglines2email.conf.sample> that you can use by copying. 
     202 
     203The config file uses YAML syntax and most of the directives are self-discriptive. 
     204 
     205=over 4 
     206 
     207=item username, password 
     208 
     209Set your username and password for Bloglines. 
     210 
     211=item mailto 
     212 
     213Set email address that this app sends emails to. Gmail address is recommended. 
     214 
     215=item mailfrom 
     216 
     217Set email address that this app uses for C<From:> header. 
     218 
     219=item mailroute 
     220 
     221Set how to send emails. Default is to use SMTP. 
     222 
     223=item group-items (Optional) 
     224 
     225With this directive on (set to 1), C<bloglines2email> groups updated 
     226items per feed. That reduces a volume of emails sent, and enables a 
     227better user experience with Gmail, thanks to the conversation 
     228threading based on C<Subject> header. Strongly recommended. 
     229 
     230=item date-timezone (Optional) 
     231 
     232Sets Date timezone for outgoing email C<Date:> header and I<Posted on> 
     233phrase inside email body. Default is to use local timezone on your machine. 
     234 
     235=item delicious-username (Optional) 
     236 
     237Sets your del.icio.us username. With this option set, the email body 
     238will have I<Post to del.icio.us> link, which is a handy shortcut for 
     239bookmarking items to the social bookmarking service. 
     240 
     241=head1 DEVELOPMENT 
     242 
     243The newest version is always available via subversion: 
     244 
     245  svn://svn.bulknews.net/public/bloglines2email/trunk 
     246 
     247And you can browse the files via ViewCVS at: 
     248 
     249  http://svn.bulknews.net/viewcvs/public/bloglines2email/trunk 
     250 
     251Feel free to send patches or suggestions to E<lt>miyagawa@bulknews.netE<gt> 
     252 
    130253=head1 AUTHOR 
    131254 
  • bloglines2email/trunk/bloglines2email.conf.sample

    r1649 r1650  
    33mailto: mail-address@example.com 
    44mailfrom: mail-address@example.com 
     5mailroute: 
     6  via:  smtp 
     7  host: localhost:25 
     8# mailroute: 
     9#  via:  sendmail 
    510group-items: 1 
    611date-timezone: Asia/Tokyo