cal rank blahhhed
Posted by kobif
Monday, September 27, 2004
Description: onoes!
wanna pull all the info from here
http://www.caleague.com/?page=standings&division=cso&conference=central&subdivision=omega
and return it to chan
got everything up till where it finds the info
wanna pull all the info from here
http://www.caleague.com/?page=standings&division=cso&conference=central&subdivision=omega
and return it to chan
got everything up till where it finds the info
alias -l htmlfree {
; It's local because it won't be used by the command line, only this file.
; Local aliases avoid conflicting names.
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
on *:text:@help *:#:{
if ($1 == rank) { msg $chan Syntax: @rank division (cso, csi, csm, csp, cs) conference (central, atlantic, pacific) subdivision (omega, theta, delta, gamma) CAL team name }
if ($1 == wz) { msg $chan Syntax: @wz ZIPcode / City, ST }
if ($1 == steamid
}
on *:text:@rank *:#:{
if ($4-) {
set %rank.div $1
set %rank.conf $2
set %rank.sub $3
set %rank.team $4
; Variables to be used in the future URL are being set here!
sockopen calrank caleague.com 80
}
else {
echo -a Error :/ (not enough info provided @help rank)
}
on *:sockopen:calrank:{
sockwrite -n $sockname GET /?page=standings&division= $+ %rank.div $+ &conference= $+ %rank.conf $+ &subdivision= $+ %rank.sub HTTP/1.1
; This is telling the socket to connect to the specific page, using "GET".
sockwrite -n $sockname Host: caleague.com $+ $crlf $+ $crlf
; This states the host once again.
}
on *:sockread:calrank:{
if ($sockerr) {
msg $chan Error. :/
halt
}
else {
var %calrank
sockread %calrank
if ( *BLAHHHHHHHRG* iswm %temptext) {
echo -a -
echo -a $htmlfree(%temptext)
}
}
}