Base version: DadaMail 2.10.12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Dada Digest Script</title> <link rel="stylesheet" href="/Users/justin/Documents/DADA/DISTRO/dada/extras/documentation/pod_source/pod_styles.css" type="text/css" /> <link rev="made" href="mailto:root@b28.apple.com" /> </head> <body> <p><a name="__index__"></a></p> <!-- INDEX BEGIN --> <ul> <li><a href="#name_dada_digest_pl">NAME dada_digest.pl</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#instructions">INSTRUCTIONS</a></li> <li><a href="#installtion">INSTALLTION</a></li> <ul> <li><a href="#options">OPTIONS</a></li> <li><a href="#setting_up_a_digest">SETTING UP A DIGEST</a></li> <li><a href="#setting_up_a_cron_tab">Setting up a Cron Tab</a></li> </ul> <li><a href="#copyright">COPYRIGHT </a></li> </ul> <!-- INDEX END --> <hr /> <p> </p> <hr /> <h1><a name="name_dada_digest_pl">NAME dada_digest.pl</a></h1> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>Creates a digest message from one list, to be sent to another list.</p> <p> </p> <hr /> <h1><a name="instructions">INSTRUCTIONS</a></h1> <p>dada_digest.pl is designed to be called from the command line or a cron job. It is not a cgi script and shys away from the limelight that is the Graphical WWW.</p> <p> </p> <hr /> <h1><a name="installtion">INSTALLTION</a></h1> <p>You need to change two things on the top of dada_digest.pl, the first is the <strong>$Digests</strong> variable which we'll get to shortly, the second thing you need to do is set the path to both the Dada libraries and your site's Perl library. Since dada_digest.pl will most likely but run from a cron job, it doesn't know off the bat where the Perl or the Dada libraries are. You tell the script where these places are by tweaking the 'use lib' statement:</p> <p>use lib qw( /home/account/public_html/cgi-bin/dada/ /home/account/public_html/cgi-bin/dada/DADA /home/account/public_html/cgi-bin/dada/DADA/perllib /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 );</p> <p>The first two are where my Dada libraries are, they're in my cgi-bin right along with mail.cgi. The ones after that are places where the site-wide Perl libraries are located.</p> <p>Upload dada_digest.pl to your hosting account. I recommend NOT putting this script in your cgi-bin, simply because it isn't a cgi-script. You may want to make a directory for dada scripts like this one in your home account:</p> <pre> mkdir /home/account/dada_scripts</pre> <p><strong>Putting this script in your cgi-bin would probably constitute a security threat!</strong></p> <p>change the permissions of dada_digest.pl to 755.</p> <p>To use this script, simple run it:</p> <pre> >perl dada_digest.pl</pre> <p>That's the essence of it.</p> <p> </p> <h2><a name="options">OPTIONS</a></h2> <dl> <dt><strong><a name="item__2d_2dtest">--test</a></strong><br /> </dt> <dd> running dada_digest.pl with the test option will only send out the digest to the list owner. Very handy for testing purposes. </dd> <dd> <pre> >perl dada_digest.pl --test</pre> </dd> <p></p> <dt><strong><a name="item__2d_2dreset_listname">--reset listname</a></strong><br /> </dt> <dd> This takes a bit of explaination, but it basically resets the time dada_digest.pl remembers when it last sent out a digest. If I send out a digest ever day, dada_digest.pl will remember this and won't send out a message in a digest it has already sent. This will make dada_digest.pl forget this. </dd> <dd> <pre> >perl dada_digest.pl --reset listname</pre> </dd> <dd> <p>listname is the shortname of the list you're grabbing the messages to be digested, not the digest list</p> </dd> <p></p></dl> <p> </p> <h2><a name="setting_up_a_digest">SETTING UP A DIGEST</a></h2> <p>To set up a digest, You need to have two lists, a list to grab the messages to be digested from and a list to send the digest. I made a list with a shortname of 'test' and another with a shortname of 'digest_test'</p> <p>People who want to have every single message sent to them would want to subscribe to 'test', people who want the digest would want to subscribe to 'digest_test'</p> <p>I then have to decide what sort of time span I want to send my digest. I'm thinking every day will work for me.</p> <p>Now, dada_digest.pl needs to know all of this. On the top of the script itself is a variable called '$Digests'. To put the above information that I just worked out into $Digests, I'd write:</p> <pre> my $Digests = [ { List_Name => 'test', Digest_List_Name => 'digest_test', Message_History => 24, }, ];</pre> <p>Message_History work in hours, so one day equals 24 hours.</p> <p>If I had another list, called ``ramblings'' and a list for digests called ``digest_ramblings'', that I wanted sent every 3 hours, I'd put that after my first one:</p> <pre> my $Digests = [ { List_Name => 'test', Digest_List_Name => 'digest_test', Message_History => 24, }, { List_Name => 'ramblings', Digest_List_Name => 'digest_ramblings', Message_History => 3, }, ];</pre> <p>All there is to it.</p> <p> </p> <h2><a name="setting_up_a_cron_tab">Setting up a Cron Tab</a></h2> <p>You're most likely going to run dada_digest.pl via a crontab. Here's an example of one:</p> <pre> 0 0,3,6,9,12,15,18,21 * * * /home/account/dada_scripts/dada_digest.pl</pre> <p>This will run the script every 3 hours to check if any digests need to be sent out.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright (c) 1999 - 2003 Justin Simoni <a href="mailto:me@justinsimoni.com">me@justinsimoni.com</a> <a href="http://justinsimoni.com">http://justinsimoni.com</a> </p> <p>All rights reserved. </p> <p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. </p> <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. </p> <p>You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. </p> </body> </html>
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |