[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Program to send site traffic reports via email autoresponder (was Log files)



WebWorkshop <webmaster@xxxxxxxxxxxxxxx> wrote:
> I once had a hosting service (now out of business) where, via a form, you
> could enter your site's URL, your password, and e-mail address, and in a
> short while you'd receive a text e-mail with some detailed and useful stats.

I like it.

> Does anyone know of a stats program like this that would work for virtual
> hosts on a RaQ?

I don't know of any, but it wouldn't be too hard to do.  If I was going to do it
I'd do something like this:

Use MySQL to slurp new records from the log files nightly and generate summary
reports saved in MySQL or text files automatically using crontab.  Create an
email address dedicated to automated customer stats delivery and then add a
record in a Sendmail aliases file to redirect the email to a PHP script. Write a
PHP script to parse the email address of the sender, look it up in a MySQL table
and grab the corresponding text file location or the record in a separate MySQL
table containing the report output.  Read the text file or MySQL data into a
variable and then send it back to the user via the mail() function or a mail or
smtp PHP class.

It might sound like a lot, but someone fluent in PHP and MySQL can write it,
install it and test it in under a day.  If I had the time I'd love to write
something like that and use it myself.  There very well could be a Perl program
that generates the reports on the fly from log files, but I'm not aware of one
and I prefer to do all the heavy processing at night when the server's not
highly loaded than during the day as the requests are coming in via email.

--
Steven Werby {steven-lists@xxxxxxxxxxxx}