Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl routines for tracking by day of week, month, etc -

know of any open source applications with good tracking by time?

         

jeremy goodrich

7:41 pm on Jul 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thinking of adding some more functionality to an application that I wrote recently - but, I haven't programmed any "clicks by day" "clicks by week" etc routines before.

Now, it seems that tracking by time increment in a perl / cgi script would be a relatively common thing - are there any modules, or open source scripts with good tracking functionality by time that I could port over to my existing application?

It's more or less a tracking application, and I am combining it into a keyword tool ;) which should be fun. However, the CGI admin interface I built does a run through the entire flat file to show some data, and if it had the functionality of "show last day" or "show today" etc - it would reduce the load when I run the script.

Any ideas?

jatar_k

12:00 am on Aug 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



jeremy, you're just getting no love on this one, anyone have any thoughts?

I can't comment on specific modules but are you planning to get the numbers from your logs? I have to admit that I don't totally get what you are looking for.

which might be why no one answered ;)

sugarkane

8:50 am on Aug 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The way I do it is to convert the dates back and forth from a timestamp value, and use numerical operators to select the date range I'm interested in. I.E.:

if ($time > $lowertimestamp && $time < $highertimestamp) { &do_stuff; }

Converting from timestamp to string-format date is done with the standard time(), gmtime() or localtime() functions, while generating a timestamp from a string can be done with mktime() which is part of the POSIX module.

jeremy goodrich

5:01 pm on Aug 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



he he he, yes, -confusing post.

Time format I'm using:

Thu Jul 31 22:12:53 2003

I'm building a custom tracking application for my sites - which, I am going to build some filters for so I can see trends by day, week, month, etc.

And since most of the calculations to compare the time of one log entry to another, or to sort & group entries by day, week, or month must already have been written a time or two by somebody else - I was wondering if there were any generic modules with good routines for sorting a log entry by day, week, etc.

Does that help? ;) suppose I could go look, grumble, grumble...