SearchIRC Network Rank

By GrimReaper on Nov 25, 2010

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. }
}

Comments

Sign in to comment.
Dark|   -  Nov 25, 2010

Ahhk
i dont know much about msl yet,
Just the easy stuff

 Respond  
GrimReaper   -  Nov 25, 2010

Thanks. I've only recently started using regex. I wanted to learn it as it's an easier way to gather information than using thing's like $gettok and the $htmlfree alias.

 Respond  
Dark|   -  Nov 25, 2010

Ahh, Ok. nice job tho :D

 Respond  
GrimReaper   -  Nov 25, 2010

Depends on if they are listed within SearchIRC. If they aren't. It will return an error saying that it is not listed.

 Respond  
Dark|   -  Nov 25, 2010

Will this work with small servers?
or nah?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.