All pastes #196412 Raw Edit

Clan

public text v1 · immutable
·published 2006-10-10 15:52 UTC
rendered paste body
on *:text:@clan*:#:{
  /set %csearch.chan $chan
  /set %csearch.nick $2
  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) { msg %csearch.chan Sorry an error occured. }
  else {
    if ( *'ml.php?clan=*'>*</a></td> iswm %cstatus ) { msg %csearch.chan 2 %csearch.nick 3is in 2 $htmlfree(%cstatus) }
  }
}

alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}

}
}