FcLan Halfop
Joined: 30 Sep 2005 Posts: 64 Location: Poland
|
Posted: Thu Dec 29, 2005 11:11 am Post subject: Live ticker bot |
|
|
I`m working for live ticker bot with eurosport.com site, but, bot sends minutes from bottom site, but the oldest commentary, I don`t want to use http where geturl is a command i want to use a socket but how change it..
| Code: | 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: | [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: | 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 |
Please help, must be way to get info from top ! |
|