Code
on *:START: { hmake slogan 1 | hload slogan slogan.txt }
on *:TEXT:*:*: {
; if (+slogan !isin [ % $+ [ $remove(#,$chr(35)) ] ]) return
if $1 == !slogan || $1 == !слоган {
if $2 { sockopen slogan. [ $+ [ $chan ] $+ . $+ [ $nick ] ] slogen.ru 80 | sockmark slogan. [ $+ [ $chan ] $+ . $+ [ $nick ] ] $replace($2-,$chr(32),$chr(37) $+ 20) }
else { msg # $nick Для генерации слогана используй: $1 <word> }
}
}
on *:SOCKOPEN:slogan.*: {
if $sockerr { msg $replace($gettok($sockname,2-3,46),$chr(46),$chr(32)) $+ , $replace($hget(slogan,$rand(1,$hget(slogan,0).item)),<slogan>,$sock($sockname).mark) }
; sockwrite -n $sockname GET /s/ $+ $sock($sockname).mark HTTP/1.0 $+ $crlf $+ Host: slogen.ru $+ $crlf $+ Connection: keep-alive $+ $crlf $+ $crlf
sockwrite -n $sockname GET /pda/index.php?slogan= $+ $sock($sockname).mark HTTP/1.0 $+ $crlf $+ Host: slogen.ru $+ $crlf $+ Connection: keep-alive $+ $crlf $+ $crlf
}
on *:SOCKREAD:slogan.*: {
var %i | sockread %i
if ( div class="slogan1" isin %i ) {
var %s $remove($gettok(%i,2,62),</div)
msg $gettok($sockname,2,46) $strip($lib.utf8decode(%s))
sockclose $sockname
}
hadd slogan $calc($hget(slogan,0).item + 1) $strip($lib.utf8decode(%s)) | hsave slogan slogan.txt
Ъ