napa182 commented on a Page, !BroCode bot script  -  Mar 29, 2010
on $*:text:/^@bro\s(\d+)$/iS:#: {
  if ($regml(1) isnum 1-62) {
    if ($hget(bro)) hfree bro
    if ($sock(bro)) sockclose bro
    sockopen bro www.thebrocode.co.uk 80
    set -u4 %w $+(/<a href=.+article=,$regml(1),">(Article.+)<\/a><\/div>/)
    sockmark bro $+(/thecode.cgi?search=,$regml(1)) msg # 
  }
}
on *:sockopen:bro: {
  sockwrite -nt $sockname GET $gettok($sock(bro).mark,1,32) HTTP/1.1
  sockwrite -nt $sockname Host: $+(www.thebrocode.co.uk,$str($crlf,2))
}
on *:sockread:bro: {
  var %bro | sockread %bro
  if ($regex(%bro,%w)) {
    hadd -m bro say $remove($regsubex($regml(1),/&#(\d+);/g,$chr(\1)),<b>,</b>)
    $gettok($sock(bro).mark,2-3,32) $gettok($hget(bro,say),1-60,32) 
    $iif($gettok($hget(bro,say),61-,32),$gettok($sock(bro).mark,2-3,32) $v1) 
    sockclose bro
  }
}
 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.