Forum OpenACS Q&A: Response to Clickstream solutions

Collapse
Posted by Jeff Davis on
here is the copy I have:
# $Id: cs-avail.tcl,v 3.1 2000/04/10 15:17:21 jsalz Exp $
# File:        cs-avail.tcl
# Date:        6 Apr 2000
# Author:      jsalz@mit.edu
# Description: Returns a list of times in the past week for which clickstreaming data are
#              available.

ReturnHeaders "text/plain"

set time [cs_get_current_chunk]

set log_file [cs_log_file]
set files [glob "$log_file.*"]

set avail [list]

for { set i 0 } { $i < 24*7 } { incr i } {
    if { [lsearch $files "$log_file.[cs_format_log_file_date $time]"] >= 0 } {
        lappend avail $time
    }
    incr time -3600
}
ns_write $avail