i need a script what can make a live index page that will show all public msg fron a channel & it will update that html page in evry 1 min that can help me out to see all the public msg of a channel live ...
Last edited by CuteBangla on Sat Apr 15, 2006 1:55 am, edited 1 time in total.
set logfile "/home/blabla/public_html/index.html"
bind pubm - * cmd:log
bind pubm - * cmd:log
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds]]
puts $cmdlog "\[$timestamp\] $t used by $n in $c"
close $cmdlog
}
i want to have that as html file
that any1 can see & mayb that index file ill refresh after evry X seconds or after a new public message in the channel .... & delet old line after evry 20 new lines ...
DragnLord wrote:Look at the second script I wrote in this thread.
set logfile "/home/blabla/public_html/index.html"
bind pubm - * cmd:log
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
puts $cmdlog "\[$timestamp\] <$n> $t <br>"
close $cmdlog
}
set logfile "/home/blabla/public_html/index.html"
# set for logfile length
set linecount 20
bind pubm - * cmd:log
set filecount 0
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
puts $cmdlog "\[$timestamp\] <$n> $t <br>"
close $cmdlog
set pline [lindex [exec wc -l ${::logfile}] 0]
if {${::filecount} >= ${::linecount}}{
exec tail -n${::linecount} ${::logfile} > ${::logfile}
set ::filecount 0
}
incr ::filecount
}
Give this a try. Should update the webpage the way you want.
set logfile "/home/blabla/public_html/index.html"
# set for logfile length
set linecount 20
bind pubm - * cmd:log
set filecount 0
proc cmd:log {n u h c t} {
set cmdlog [open ${::logfile} a+]
set timestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]
puts $cmdlog "\[$timestamp\] <$n> $t <br>"
close $cmdlog
set pline [lindex [exec wc -l ${::logfile}] 0]
if {${::filecount} >= ${::linecount}}{
exec tail -n${::linecount} ${::logfile} > ${::logfile}
set ::filecount 0
}
incr ::filecount
}
Give this a try. Should update the webpage the way you want.