All pastes #470067 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-04 01:14 UTC
rendered paste body
hhon *: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 %csearch.nick is in $htmlfree(%cstatus) }
  }
}
alias -l htmlfree {
  ; Cleans all html from a file
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}