This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Live ticker bot

Help for those learning Tcl or writing their own scripts.
Post Reply
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Live ticker bot

Post by FcLan »

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: 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
Please help, must be way to get info from top !
Post Reply