All pastes #190468 Raw Edit

Untitled

public text v1 · immutable
·published 2006-10-04 00:49 UTC
rendered paste body
alias htmlstrip { var %x,%y = $regsub($1-,/(<[^>]+>)/g,$null,%x) | return %x }
ON $*:TEXT:/^[!@]clan/Si:#:{
  /set %csearch.chan $chan
  /set %csearch.nick $2-
  /set %csearch.user $nick
  /set %csearch.send $iif($Left($1,1) == !,.Notice $nick,.Msg $chan)
  if ($sock(clansearch)) { /sockclose search }
  /sockopen clansearch runehead.com 80
}

on *:sockopen:clansearch:{
  sockwrite -nt $sockname GET /clans/search.php?search= $+ %csearch.nick $+ &searchtype=exact HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf $crlf 
}

on *:sockread:clansearch:{
  /var %cstatus  
  sockread %cstatus
  if ($SockErr) { .notice %csearch.user Sorry an error occured. }
  else {
  if ( *'ml.php?clan=*'>*</a></td> iswm %cstatus) %csearch.send 4 %csearch.nick is in12 $htmlstrip(%cstatus) }
  elseif (No results were found for the  search iswm %cstatus) { .msg %csearch.chan 4 %csearch.nick is not on4 http://www.runehead.com/clans/ml.php? }  
}
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}