This is just basically a script to gather the SearchIRC Network Rank for whichever Network you specify. It will error if there is no Network said and if there is a socket open to SearchIRC at the time.
Syntax: !Rank
on *:TEXT:!Rank*:#: {
if (!$2) { msg $chan Please search for a Network to gather the SearchIRC Rank. }
elseif ($sock(IRCRank)) { msg $chan Please wait till this current search has finished. }
else {
sockopen IRCRank searchirc.com 80
sockmark IRCRank $+(/network-alpha/,$left($2,1),/ALL) $2 msg $chan
}
}
on *:SOCKOPEN:IRCRank: {
if ($sockerr) { $gettok($sock(IRCRank).mark,3-4,32) Error connecting to server. Please try again. | .sockclose IRCRank }
else {
var %a = sockwrite -n $sockname
%a GET $gettok($sock(IRCRank).mark,1,32) HTTP/1.0
%a Host: $+($sock(IRCRank).addr,$str($crlf,2))
}
}
on *:SOCKREAD:IRCRank: {
var %IRCRank | sockread %IRCRank
if ($regex(%IRCRank,/<a rel='nofollow' href="\/rank\/ $+ $gettok($sock(IRCRank).mark,2,32) $+ "><font color="#999999">Ranked \#(.*?)<\/font><\/a>/i)) {
$gettok($sock(IRCRank).mark,3-4,32) $+($gettok($sock(IRCRank).mark,2,32),'s) SearchIRC Ranking is: $regml(1)
set -u5 %IRCRankfound on
.sockclose $sockname
}
}
on *:SOCKCLOSE:IRCRank: {
if (!%IRCRankfound) { $gettok($sock(IRCRank).mark,3-4,32) $gettok($sock(IRCRank).mark,2,32) was not found on SearchIRC's ranking. }
}