#!/usr/local/bin/tclsh
set infos { \
############################################################
# PUSH.CGI V1 WRITEN BY PIERRE-MIKAEL LEGRIS #
# IN TCL SCRIPT #
# Create animations using multipart/x-mixed-replace #
# The animation is based on the access time of files #
# This program is designed to be used with a camera that #
# Would be able to store pictures in a folder #
# #
# The program parse this folder and give 3 choices #
# 1 - View a sequence a determinate from a date to another #
# On the animation part, choose the START date #
# The STOP Date and the time to wait between pictures #
# 2 - View images when they arrive in the folder #
# If you choose the Live button you'll see the last #
# image which arrived in the folder "Images". As I'm #
# not updating images you won't see any animation ;-) #
# 3 - View a determinate picture #
# #
# push.cgi MUST be used with nph-putpic.cgi #
# #
# I don't think this is working with IExplorer #
############################################################ }
## Set the path where push.cgi can find the pictures
## Must end with "/"
set path "Images/"
## Set the type of picture to display : jpg , gif
set type_of_pict "jpg"
######## Nothing Need to be changed below this line #########
set pict_path "$path*.$type_of_pict"
set date_list ""
### The procedure that parse picts by dates ###
proc tri_picts {} {
global date_list picta pict_path
set picts [glob $pict_path]
set picta(0) "0"
foreach pict $picts {
set pict_date [file mtime $pict]
set date_list "$date_list $pict_date"
set same_date [array get picta "$pict_date"]
if {$same_date != "" } {
set picta($pict_date) "$picta($pict_date) $pict"
} else {
set picta($pict_date) "$pict"
}
}
set date_list [lsort -integer $date_list]
}
### End of tri_picts ###
### Proc which create the default web page ###
proc page_default {} {
global date_list picta
puts "See an animation
"
set previous_date 0
puts "
$infos" puts "DOWNLOAD