set urllogfile "url.log" set urlwebfile "/wwwhome/goblet/public_html/blerp/urllog.html" bind pubm - * check_if_url bind topc - * check_if_url putlog "URL-catcher 1.1 by Goblet" proc check_if_url {nick uhost hand chan text} { global urllogfile urlwebfile botnick if {$nick != "*"} { foreach i $text { if {([string match "*http://*" $i]) || ([string match "*ftp://*" $i]) || ([string match "*www.*" $i]) || ([string match "*ftp.*" $i])} { set fd [open $urllogfile a+] if {[string match "*www.*" $i] && ![string match "*http://*" $i]} { set i "http://$i" } if {[string match "*ftp.*" $i] && ![string match "*ftp://*" $i]} { set i "ftp://$i" } set fd [open $urllogfile r] while {![eof $fd]} { gets $fd foo set foo [split $foo " "] if {[lindex $foo 0] == $i} { close $fd putlog "Already heard URL said by $nick" return 0 } } close $fd set fd [open $urllogfile a+] puts $fd "$i [ctime [unixtime]] $nick ($uhost)" close $fd putlog "URL detected ($nick)" set fd [open $urlwebfile w] set fd2 [open $urllogfile r] puts $fd "Catched URLs" puts $fd "" puts $fd "
URLs catched by $botnick

" puts $fd "" while {![eof $fd2]} { gets $fd2 foo set foo [split $foo " "] set foo "[lindex $foo 0]
[join [lrange $foo 1 end]]

" if {$foo != "


"} {puts $fd $foo} } puts $fd "
© " puts $fd "Goblet 1997
" puts $fd "" close $fd close $fd2 } } } }