mojo_stats.pl - A simple statistics script for Mojo Mail lists. A better explaination of this script is located after the few things you need to change for this script to work
example:
my $stat_dir = '/usr/home/account/mojo_stats';
perl -e 'foreach(@INC){ print $_,"\n"}'
in a telnet session to get a list of various perl libs to use.
example:
use lib '/usr/local/lib/perl5/site_perl/5.005';
example:
use lib '/usr/home/account/public_html/cgi-bin/mojo'; use lib '/usr/home/account/public_html/cgi-bin/mojo/MOJO';
It tries to do a few things, but most importatly, it helps you get a good idea on what's going on with your subscriber list. Is it growing? Shrinking? Where are people coming from? How many total people are subscribed?
This script creates two tab delimited files that you can then open in a spreadsheet application, like Excel and make pretty little line graphs of what's going on with your lists. Every time its run, it'll create a new line of data. A smart thing to do would be to run this script once a day, thus giving you a snapshot of that day. The two files it creates are:
The first thing mojo_stats does is take count of email addresses by Top Level Domain, like .com, .edu, and so forth. You can change what Top Level Domain mojo_stats.pl works with by changing the @DOMAINS array in the Config.pm, instructions are provided in the Config.pm file itself. This is useful to see from where are people are coming form to subscribe to your list. You may find that you have a large college following if you have many '.edu' Top level Domains, or many people are coming from Japan if you have a big 'jp' number. Things like that. The tab-delimited file kinda looks like this:
Sun Mar 18 23:15:23 2001 1633 1321 61 5 1 179 1 10 55
Which isn't the most exciting thing in the world, but is easy for a spreadsheet to handle, here's the default format lables:
Date Total com edu gov mil net nu org Other
The first column is the date, the second column is the total number of subscribers on your list. That may be all you care about and you can do a great deal with just that. The rest of the numbers depend on what you have in your @DOMAINS array, but its basically the Top Level Domains you want to track, in alphabetical order. After that, is the number of subscribers that don't fall in any of the other categories If you change the @DOMAINS array in the Config.pm while you're using this script, your file's format will change and that not site well with the number crunchers. If I added 'foo' to the @DOMAINS array, its entry will go between 'edu' and 'gov' and all the rest after 'foo' will get pushed to the right. See what I'm saying?
The second file that is created per list is the Internet Email Services table, which keeps track of free email services and other trackable ones like, yahoo!'s mail services, aol.com, etc. This is set by the %SERVICES hash in the Config.pm file. This file has a similar format to the above:
Sun Mar 18 23:15:23 2001 506 6 5 207 8 0 84 817
First column is the date, second is the total amount of email addresses, the next are your services, in alphabetical order, the default label would look like this:
Date Tota AOL Compuserve Excite Mail Hotmail MSN Prodigy Yahoo! Other
(note that 'Excite Mail' is one Service) After those, anything that doesn't fall in those categories gets written under 'Other'
Everytime this script is run, it'll write to two files per list, the domains file and the services file, the filename will be something like listname-domains.txt and listname-services.txt It'll write one line of info, explained above. This script should really be run by a cron job, say everyday at midnight. This will give you a daily snapshot of your list, and then the statistics folks can go crazy and you can get a better picture of what's happening on your list. you can go to your client or your busines partner and show them how many people have subscribed and how well you're doing your job and everyone is happy.
This script is just a starting point. the easiest thing to do with the files this script creates is to pull it into Excel, which can do all kinds of crazy stuff to thingies in tables.
The other thing you can do is create a script that takes the information in the files and create a report out of it. This is something else you could run via a cronjob, say at 1am every day, so when you wake up, you can see exactly what is going on with your Mojo lists, and try to pick out trends.
This script is a bare bones example of what you can do, feel free to add on to it, or tweak it to your hearts content. Most of the hard work in this script (the sorting) is done with the help of the Mojo Mail Library Modules. This script is also here to show off what can be done.
This script is written by Justin Simoni, the creater of Mojo Mail:
Justin Simoni + http://www.skazat.com + justin@skazat.com
I'm available for freelance design and web programming work, related to this script, Mojo Mail, or any other project that you may have in mind. I'm presently a college student at the University of Colorado.
This program is Open Source Software and is covered under the General Public License. You should have gotten a copy of the license with this script. if not, you can view a copy at: http://www.gnu.org/copyleft/gpl.html
Copyright (c) 1999 - 2002 Justin Simoni (justin@skazat.com) http://skazat.com All rights reserved.
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.
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.
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.