ronanmagee — 2005-06-24T05:52:26-04:00 — #1
Hope this is the right forum - does anyone know if there is currently a means where by I could email an awstats summary to the owner of the site.
I have awstats installed and it works 100%, but I dont want him/her loggin in every month to check the stats, I'd rather run a cronjob to email them.
aussiegirl — 2005-07-02T00:08:50-04:00 — #2
I've seen this script being asked for before at WebHostingTalk but never have I seen it answered Sorry. I'd love to see this script too.
ronanmagee — 2005-07-04T04:45:07-04:00 — #3
I'll go and see if I can find anything else on the net ... if so I'll post it here.
ronanmagee — 2005-07-12T09:21:38-04:00 — #4
Ok - I've attempted to create a script to get the awstats file for the previous month. It uses cURL and mail().
Copy the stats_email.inc to your server (this is the email script - kindly borrowed from phpWizard - Modified by Tobias Ratschiller)
You would add an entry in to cron to get call the stats.inc script on the 2nd of the month. This would then email the awstats for the previous month to the recipient(s). NOTE: Stats.inc needs to be modified for your domain.
a. Currently only works for awstats.
b. Only seems to send to gmail address (instant) and AOL at present (took time to reach AOL address) - tested with hotmail as well, still not recieved.
c. Images do not appear in the report, meaning graphs arent coloured.
d. Coding might not be the best.
Please feel free to modify and work on - only request I as is that you post any new stuff back here for all to use ...
dkg2000 — 2005-07-20T20:29:26-04:00 — #5
I cleaned up and modified this script to make it easier for people to configure it. Unfortunately, the graphical components are still not part of the attachments so the graphs don't work well in the AwStats report.
Feel free to iterate on what I have done
ronanmagee — 2005-07-21T05:15:57-04:00 — #6
Excellent work dave ...
Yeah - that was a problem I was having ... being able to grab the graphs/images ... going to investigate curl a bit more to see if there is anyway to grab the images as well.
I was thinking ... once you hit the page via curl in the browser the images are displayed ... wonder could we make a PDF of it and use this in the mail?
Also, I wreckon it wouldnt be hard to modify the script to grab stats for Analog or Webalizer.
dkg2000 — 2005-07-22T13:30:33-04:00 — #7
The thing is when you use display the result of curl in a browser, it is the browser that goes off and gets the images from the storage location -- not curl. I was thinking of modifying all the different img directives (and there are a lot of different ones mainly due to different colors, etc) to use one simple image that I could include as an attachment to the email. I would also then want the report to actually be in the body of the email message so the email client would know how to embed the simple image properly.
The other possibility is to completely replace the img and modify the table cells with different background colors. The graphs would have the different colors but it would look flat.
Creating a PDF from the report might be another idea but I need to check for scripts out there that can render HTML into a PDF.
I might find time to work on this again this weekend... then again nice weather tends to pull me outside