Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l mychan { return #itna }
- ON *:JOIN:$($mychan): {
- if ($nick == $me) { .timer[AUTO_FORUM] 0 60 it_forum }
- }
- alias it_forum {
- if ($status !== connected) || ($me !ison $mychan) { return }
- :st
- var %s = it_forum_ $+ $ticks $+ $ctime $+ $rand(1,10000000)
- if ($sock(%s)) { goto st }
- sockopen -e %s i-tna.net 443
- sockmark %s /forum/viewforum.php?forum_id=4
- }
- ON *:SOCKOPEN:it_forum_*: {
- if ($sockerr) { return }
- sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
- sockwrite -n $sockname Host: $sock($sockname).addr
- sockwrite -n $sockname User-Agent: */*
- sockwrite -n $sockname Connection: Close
- sockwrite -n $sockname $crlf
- }
- ON *:SOCKREAD:it_forum_*: {
- if ($sockerr) { return }
- var %r
- sockread %r
- ; echo -ag READ: %r
- if (*stickythread.gif* !iswm %r) && (*<td align='center'* iswm %r) && (*style='white-space:nowrap'* iswm %r) && (*<img src='* iswm %r) && (*class='tbl2'* iswm %r) {
- var %url = $gettok(%r,18,39)
- if (%url == %it_forum_old) { sockclose $sockname | return }
- var %title = $httpstrip(%r)
- set -e %it_forum_ [ $+ [ $sockname ] $+ ] _title %title
- set -e %it_forum_ [ $+ [ $sockname ] $+ ] _url %url
- set -e %it_forum_ [ $+ [ $sockname ] $+ ] _read 1
- }
- if (*<td width='1%' class='tbl2' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) { set -e %it_forum_ [ $+ [ $sockname ] $+ ] _by $httpstrip(%r) }
- if (*<td align='center' width='1%' class='tbl1' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) { set -e %it_forum_ [ $+ [ $sockname ] $+ ] _views $httpstrip(%r) }
- if (*<td align='center' width='1%' class='tbl2' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) { set -e %it_forum_ [ $+ [ $sockname ] $+ ] _replies $httpstrip(%r) }
- if (*<td width='1%' class='tbl1' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) {
- var %title = %it_forum_ [ $+ [ $sockname ] $+ ] _title
- var %views = %it_forum_ [ $+ [ $sockname ] $+ ] _views
- var %url = %it_forum_ [ $+ [ $sockname ] $+ ] _url
- var %rep = %it_forum_ [ $+ [ $sockname ] $+ ] _replies
- var %by = %it_forum_ [ $+ [ $sockname ] $+ ] _by
- var %on = $httpstrip(%r)
- var %link = https://i-tna.net/forum/ $+ %url
- set %it_forum_old %url
- if ($status == connected) && ($me ison $mychan) { .msg $mychan iTNA.NET - Forum - iTNA Role-Playing -> Title: $+ %title $+ -=- View(s): $+ %views $+ -=- Replie(s): $+ %rep $+ -=- Created by: $+ %by $+ -=- Created on: $+ %on $+ -=- Link: $+ %link $+ }
- unset %it_forum_ [ $+ [ $sockname ] $+ ] _*
- sockclose $sockname
- return
- }
- }
- alias httpstrip {
- var %xx = $replace($1-,&,$chr(38),$chr(124),-,$chr(125),-,},-,|,-,",$chr(34),&,&,<,<,>,>, ,$chr(32),&#039;,$chr(39),$chr(13),$chr(32))
- var %x = $remove(%xx,<![CDATA[,]]>,$chr(2),$chr(4),$chr(9),$chr(31),$chr(22),$chr(29),$chr(10),$chr(13))
- var %i = $regsub(%x,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
- return %x
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement