All pastes #167619 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-12 04:23 UTC
rendered paste body
on *:text:!clan*:#test:{
  /set %csearch.chan $chan
  /set %csearch.nick $2
  /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
} ;Ends the html cleaner alias