Advertisement
westor

iTNA.oRg forum informer for Sherby v1.0

Nov 11th, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.94 KB | None | 0 0
  1. ON *:JOIN:#itna: {
  2.   if ($nick == $me) { .timer[AUTO_FORUM] 0 60 it_forum }
  3. }
  4.  
  5. alias it_forum {
  6.   if ($me !ison #itna) { return }
  7.   :st
  8.   var %s = it_forum_ $+ $ticks $+ $ctime
  9.   if ($sock(%s)) { goto st }
  10.   sockopen %s i-tna.org 80
  11.   sockmark %s /forum/viewforum.php?forum_id=4
  12. }
  13.  
  14. ON *:SOCKOPEN:it_forum_*: {
  15.   if ($sockerr) { return }
  16.   sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.0
  17.   sockwrite -n $sockname Host: $sock($sockname).addr
  18.   sockwrite -n $sockname User-Agent: */*
  19.   sockwrite -n $sockname Connection: Close
  20.   sockwrite -n $sockname $crlf
  21. }
  22.  
  23. ON *:SOCKREAD:it_forum_*: {
  24.   if ($sockerr) { return }
  25.   var %r
  26.   sockread %r
  27.   ; echo -ag READ: %r
  28.   if (*alt='Sticky* !iswm %r) && (<td align='center'* iswm %r) && (*style='white-space:nowrap'>* iswm %r) && (*<img src='../themes/Paradox/forum/* iswm %r) && (*class='tbl1'>* iswm %r) {
  29.     var %url = $gettok(%r,18,39)
  30.     if (%url == %it_forum_old) { sockclose $sockname | return }
  31.     var %title = $httpstrip(%r)
  32.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _title %title
  33.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _url %url
  34.     set -e %it_forum_ [ $+ [ $sockname ] $+ ] _read 1
  35.   }
  36.   if (*<td width='1%' class='tbl2' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) { set -e %it_forum_ [ $+ [ $sockname ] $+ ] _by $httpstrip(%r) }
  37.   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) }
  38.   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) }
  39.   if (*<td width='1%' class='tbl1' style='white-space:nowrap'>* iswm %r) && (%it_forum_ [ $+ [ $sockname ] $+ ] _read) {
  40.     var %title = %it_forum_ [ $+ [ $sockname ] $+ ] _title
  41.     var %views = %it_forum_ [ $+ [ $sockname ] $+ ] _views
  42.     var %url = %it_forum_ [ $+ [ $sockname ] $+ ] _url
  43.     var %rep = %it_forum_ [ $+ [ $sockname ] $+ ] _replies
  44.     var %by = %it_forum_ [ $+ [ $sockname ] $+ ] _by
  45.     var %on = $httpstrip(%r)
  46.     var %link = http://i-tna.org/forum/ $+ %url
  47.     set %it_forum_old %url
  48.  
  49.     .msg #iTNA iTNA.oRg - Forum - iTNA Role-Playing -> Title:  $+ %title $+  -=- View(s):  $+ %views $+  -=- Replie(s):  $+ %rep $+  -=- Created by:  $+ %by $+  -=- Created on:  $+ %on $+  -=- Link:  $+ %link $+ 
  50.  
  51.     unset %it_forum_ [ $+ [ $sockname ] $+ ] _*
  52.     sockclose $sockname
  53.     return
  54.   }
  55. }
  56.  
  57. alias httpstrip {
  58.   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))
  59.   var %x = $remove(%xx,<![CDATA[,]]>,$chr(2),$chr(4),$chr(9),$chr(31),$chr(22),$chr(29),$chr(10),$chr(13))
  60.   var %i = $regsub(%x,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
  61.   return %x
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement