Advertisement
westor

iTNA.NET forum informer for Sherby v1.0

May 24th, 2020
2,320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.09 KB | None | 0 0
  1. alias -l mychan { return #itna }
  2.  
  3. ON *:JOIN:$($mychan): {
  4.   if ($nick == $me) { .timer[AUTO_FORUM] 0 60 it_forum }
  5. }
  6.  
  7. alias it_forum {
  8.   if ($status !== connected) || ($me !ison $mychan) { return }
  9.  
  10.   :st
  11.  
  12.   var %s = it_forum_ $+ $ticks $+ $ctime $+ $rand(1,10000000)
  13.  
  14.   if ($sock(%s)) { goto st }
  15.  
  16.   sockopen -e %s i-tna.net 443
  17.   sockmark %s /forum/viewforum.php?forum_id=4
  18. }
  19.  
  20. ON *:SOCKOPEN:it_forum_*: {
  21.   if ($sockerr) { return }
  22.  
  23.   sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
  24.   sockwrite -n $sockname Host: $sock($sockname).addr
  25.   sockwrite -n $sockname User-Agent: */*
  26.   sockwrite -n $sockname Connection: Close
  27.   sockwrite -n $sockname $crlf
  28. }
  29.  
  30. ON *:SOCKREAD:it_forum_*: {
  31.   if ($sockerr) { return }
  32.   var %r
  33.   sockread %r
  34.   ; echo -ag READ: %r
  35.  
  36.   if (*stickythread.gif* !iswm %r) && (*<td align='center'* iswm %r) && (*style='white-space:nowrap'* iswm %r) && (*<img src='* iswm %r) && (*class='tbl2'* iswm %r) {
  37.     var %url = $gettok(%r,18,39)
  38.  
  39.     if (%url == %it_forum_old) { sockclose $sockname | return }
  40.  
  41.     var %title = $httpstrip(%r)
  42.  
  43.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _title %title
  44.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _url %url
  45.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _read 1
  46.   }
  47.   if (*<td width='1%' class='tbl2' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) { set -e %it_forum_ [ $+ [ $sockname ] $+ ] _by $httpstrip(%r) }
  48.   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) }
  49.   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) }
  50.   if (*<td width='1%' class='tbl1' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) {
  51.     var %title = %it_forum_ [ $+ [ $sockname ] $+ ] _title
  52.     var %views = %it_forum_ [ $+ [ $sockname ] $+ ] _views
  53.     var %url = %it_forum_ [ $+ [ $sockname ] $+ ] _url
  54.     var %rep = %it_forum_ [ $+ [ $sockname ] $+ ] _replies
  55.     var %by = %it_forum_ [ $+ [ $sockname ] $+ ] _by
  56.     var %on = $httpstrip(%r)
  57.     var %link = https://i-tna.net/forum/ $+ %url
  58.  
  59.     set %it_forum_old %url
  60.  
  61.     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 $+  }
  62.  
  63.     unset %it_forum_ [ $+ [ $sockname ] $+ ] _*
  64.  
  65.     sockclose $sockname
  66.  
  67.     return
  68.   }
  69. }
  70.  
  71. alias httpstrip {
  72.   var %xx = $replace($1-,&#x26;,$chr(38),$chr(124),-,$chr(125),-,&#125;,-,&#124;,-,&quot;,$chr(34),&amp;,&,&lt;,<,&gt;,>,&nbsp;,$chr(32),&#x26;#039;,$chr(39),$chr(13),$chr(32))
  73.   var %x = $remove(%xx,<![CDATA[,]]>,$chr(2),$chr(4),$chr(9),$chr(31),$chr(22),$chr(29),$chr(10),$chr(13))
  74.   var %i = $regsub(%x,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
  75.   return %x
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement