Code: Select all
set url "www.eurosport.com"
proc get_live {nick uhost handle channel text} {
global url
set sock [socket $url 80]
fconfigure $sock -buffering line -buffersize 1000
puts $sock "GET /home/pages/v4/l0/s22/e10028/live_lng0_spo22_evt10028_mtc112276.shtml HTTP/1.0"
puts $sock "Host: www.eurosport.com"
puts $sock ""
puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; WindowsNT 5.0)"
flush $sock
while {![eof $sock]} {
gets $sock body
regexp -all {/><font color="FF0000"><b>(.*?)</b></font>} $body _ minute
regexp -all {(.*?)<br /><br /><b>} $body _ com
}
if {[eof $sock]} { close $sock }
regsub -all {(<.+?>)} $minute"" minute
regsub -all {(<.+?>)} $com"" com
puthelp "PRIVMSG $channel :[lindex $minute] [lindex $com]"
}
bind pub - !live get_live
Code: Select all
[16:06] <Fclan> !live
[16:06] <bot`> 23:12Â Half time in Highbury...4-0 for Arsenal after an astonishing display from the Gunners..
it should be:
Code: Select all
fclan: !live
bot: 23:12 Thanks for joining us today for our coverage of the Premiership. Please come back again on Saturday for another nine games as the Premiership continues it's Christmas programme starting at 13:45cet here on eurosport.com