[Neworleans-pm] Fwd: Perl Quiz-of-the-Week #20

Brett D. Estrade estrabd at yahoo.com
Wed Jul 21 08:50:58 CDT 2004




=====
http://www.brettsbsd.net/~estrabd

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

----- Original message -----
From: "Roger Burton West" <roger at firedrake.org>
To: perl-qotw at plover.com
Date: Wed, 21 Jul 2004 04:37:46 -0400
Subject: Perl Quiz-of-the-Week #20


IMPORTANT: Please do not post solutions, hints, or other spoilers
        until at least 60 hours after the date of this message.
        Thanks.

IMPORTANTE: Por favor, no enviéis soluciones, pistas, o cualquier otra
        cosa que pueda echar a perder la resolución del problema hasta
        que hayan pasado por lo menos 60 horas desde el envío de este
        mensaje. Gracias.

IMPORTANT: S'il vous plaît, attendez au minimum 60 heures après la
        date de ce message avant de poster solutions, indices ou autres
        révélations. Merci.

WICHTIG: Bitte schicken Sie keine Lösungen, Tipps oder Hinweise für
        diese Aufgabe vor Ablauf von 60 Stunden nach dem Datum dieser
        Mail. Danke.

BELANGRIJK: Stuur aub geen oplossingen, hints of andere tips in de
        eerste 60 uur na het verzendingstijdstip van dit
        bericht. Waarvoor dank.

VNIMANIE: Pozhalujsta ne shlite reshenija, nameki na reshenija, i
        voobshe lyubye podskazki v techenie po krajnej mere 60 chasov
        ot daty etogo soobshenija.  Spasibo.

Qing3 Zhu4Yi4: Qing3 Ning2 Deng3Dao4 Jie1Dao4 Ben3 Xin4Xi2 Zhi1Hou4 60
        Xiao3Shi2, Zai4 Fa1Biao3 Jie3Da2, Ti2Shi4, Huo4 Qi2Ta1 Hui4
        Xie4Lou4 Da2An4 De5 Jian4Yi4.  Xie4Xie4.


----------------------------------------------------------------

I run mailing lists. People subscribe, people unsubscribe, and people
get unsubscribed automatically when their addresses generate too many
bounces.

I run these mailing lists using SmartList.

I'd like to find out how my lists are being used - do people unsubscribe
in a bunch when a flame war happens, or do they just drift in and out
over time? What does the total-membership graph look like?

You are to write a function, parse_smartlist_log. It takes three
parameters:

(1) the name of a SmartList log file.
(2) the total current membership of the list.
(3) the base name of the output file.

It should parse a SmartList log file and generate a graph of total
list membership against time.

Note that not all subscriptions and unsubscriptions will be in the
log; it's possible that the listmaster has added or removed addresses
without using the administrative interface, especially when the list
was first set up. This is the reason for the second parameter. Take
whatever action seems appropriate.

(The graph can be a bitmap, ASCII, or whatever else - just give it a
sensible filename based on the third parameter.)

A log file includes lines such as:

        subscribe: foo at bar.com by: foo at bar.com  Thu Mar 21 15:30:35 GMT
        2002

        unsubscribe:   9 foo at bar.com                   32760 foo at bar.com
        by: foo at bar.com Sat Mar 23 16:27:35 GMT 2002

        procbounce: Removed: foo at bar.com            32718

SmartList has fuzzy matching on unsubscription requests - if the
addresses in the line differ, use the first one.

There are many other lines that may appear in the log file.

Sometimes, as seen above for procbounce, there may be no date on the
log line.

Some sample log files may be obtained from
        http://firedrake.org/roger/sample_logs.zip

or from

        http://perl.plover.com/qotw/misc/r020/sample_logs.zip
        http://perl.plover.com/qotw/misc/r020/sample_logs.tgz





More information about the NewOrleans-pm mailing list