alias clansock {
set %word $replace($1-,$chr(32),+)
sockopen clansock www.runehead.com/clans
}
on *:sockopen:clansock: {
sockwrite -n $sockname GET /?w= $+ %word $+ &ls=a
HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible;
MSIE 4.01; Windows NT)
sockwrite -n $sockname Host: www.runehead.com/clans
sockwrite -n $sockname Accept-Language: en-us
sockwrite -n $sockname Accept-Encoding: gzip, deflate
sockwrite -n $sockname Accept: */* $+ $crlf $+ $crlf
}
on *:sockread:clansock: {
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (*Quick Clan name* iswm %temptext) {
set %clan.clan $htmlfree($gettok($gettok(%
temptext,2,40),1,41))
}
if (<LI><b><i>* iswm %temptext) {
inc %defcnt
set %clan [ $+ [ %defcnt ] ] $htmlfree(%temptext)
}
if (<LI> $+ $chr(40) $+ <I>* iswm %temptext) {
inc %defcnt
set %clan [ $+ [ %defcnt ] ] $htmlfree(%temptext)
}
if (<P><B> $+ %word $+ </B>* iswm %temptext) {
inc %defcnt
set %clan [ $+ [ %defcnt ] ] $gettok($htmlfree(%
temptext),2-,32)
}
if (<br><table border=0 cellpadding=0 bgcolor="#ffcccc"
width=95%>* iswm %temptext) {
sockclose clansock
DisplayClan
}
if (*</html> iswm %temptext) {
sockclose clansock
DisplayClan
}
}
}
alias DisplayClan {
if (%defcnt == $null) {
msg %clanchan User cannot be found.
unset %dict.delay
return
}