on *:playend:$iif($exists(crickcommentary.txt),.remove crickcommentary.txt)
menu menubar,channel,status,nicklist {
-
Enable Cric-Commentary {
autocrickon
echo 4 -a *** Please Wait a Few Seconds While I Get You the Info...
}
}
on $*:text:/^[!@.]startmatch$/iS:#:{
if !%f { inc -u5 %f
set -u10 %ccrick # | autocrickon
msg # 4*** Please Wait a Few Seconds While I Get You the Info...
}
}
on *:sockclose:crickcom:{
if !$isfile(crickcommentary.txt) {
$iif(%ccrick,msg $v1,echo 4 -a) 4*** Sorry, No Cricket Match Found on $date $time ***
}
else { $sock(crickcom).mark }
}
on *:sockopen:crickcom:{
var %crickcom sockwrite -n crickcom
%crickcom GET $+(/score6M691.html) HTTP/1.1
%crickcom Host: $sock(crickcom).addr $+ $str($crlf,2)
}
on *:sockread:crickcom:{
var %crickcom | sockread -fn %crickcom
if $regex(%crickcom,/\S+\-\S+\:\ssmall;">(.*?)</div>/i) {
write crickcommentary.txt $regsubex($+(Announcement:,$&
$chr(32),$regml(1)),/<[^>]*>/g,)
}
elseif $regex(%crickcom,/<strong>(over)\s(\d+\.\d+)\:(.*)</div>/i) {
write crickcommentary.txt $single($+(12 $+ $regml(1),$chr(32),$chr(3),05,$&
$regml(2),$chr(3),$chr(32),:,$chr(32),$regsubex($regml(3),/<[^>]*>/g,)))
$iif(<div style="clear:both"></div> isin %crickcom,sockclose crickcom)
}
}
alias -l autocrickon {
$iif($isfile(crickcommentary.txt),write -c crickcommentary.txt)
sock $+ $iif($sock(crickcom),close,open) crickcom mathrubhumi.cricfeeds.com 80
sockmark crickcom .play # crickcommentary.txt 2000
}
alias -l single { return $regsubex($1,/(single)/ig,$+($chr(3),04,\1)) }