## This script catches urls said on channels and set on topics ## and makes a webfile of them. ## 21.7.1997 by Goblet email: goblet@sci.fi set urllogfile "urls.log" set urlwebfile "/wwwhome/goblet/public_html/blerp/urllog.html" bind pubm - * check_if_url bind topc - * check_if_url proc check_if_url {nick uhost hand chan text} { global urllogfile urlwebfile botnick 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" } puts $fd "$i
" puts $fd "[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 puts $fd $foo } puts $fd "
© " puts $fd "Goblet 1997
" puts $fd "" close $fd close $fd2 } } } putlog "URL-catcher by Goblet"