Code: Select all
proc bf_callback {sock} {
global bfNICK bfCOU
foreach line [split [egghttp:data $sock] \n] {
if {[string match "*<font size=3 class="text3"><b>*" $line] && [string match "*$bfCOU*" $line]} {
regsub -all -- {<[^>]*>} $line "" line
putserv "NOTICE $bfNICK :Boxoffice ($bfCOU) - $line"
}}
unset bfCOU
unset bfNICK
}
proc pub:office {nick uhst hand chan args} {
global bfNICK bfCOU
set cou [lindex $args 0]
if {$cou == ""} {
putserv "NOTICE $nick :Usage: .bf <usa|japan>"
return 0}
set url "http://www.mypage.us/boxoffice/"
set sock [egghttp:geturl $url bf_callback]
set bfNICK "$nick"
set bfCOU "$cou"
}