Advertisement
illpastethat

Url fetch Sr-woopy

Nov 1st, 2011
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.95 KB | None | 0 0
  1. On *:input: {
  2.   if (($1 == !noparsetitle) || ($1 == !noparse) || ($1 == !dontparsetitle) || ($1 == !noparsetitles) || ($1 == !dontparsetitles)) {
  3.     set %dontparsetitles $addtok(%dontparsetitles,$2-,44)
  4.     echo -ac info I wont be parsing for the website title $2- anymore...
  5.   }
  6.   elseif ($1 == !nolinks) {
  7.     set %nolinks $addtok(%nolinks,$iif(($2),$2,$active),44)
  8.     echo -ac info I wont be parsing links from $iif(($2),$2,$active) anymore...
  9.   }
  10. }
  11. on *:TEXT:*:#: {
  12.   if (!$istok(%nolinks,$nick,44)) {
  13.     rtc $chan $1-
  14.   }
  15. }
  16. on *:ACTION:*:#: rtc $chan $1-
  17. on *:sockopen:website.*: {
  18.   if (!$sockerr) {
  19.     tokenize 32 $($+(%,$sockname),2)
  20.     sockwrite -n $sockname GET $2 HTTP/1.1
  21.     sockwrite -n $sockname Host: $1
  22.     sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
  23.     sockwrite -n $sockname Accept: */*
  24.     sockwrite -n $sockname Connection: Close
  25.     sockwrite -n $sockname $crlf
  26.   }
  27.   else unset $+(%,$sockname)
  28. }
  29. on *:sockread:website.*: {
  30.   var %x, %z = $sockname, %e = $($+(%,%z),2)
  31.   sockread -f %x
  32.   if ($regex(%x,/<title[\w\s="]*>(.*?)<\/title>/i)) {
  33.     tokenize 32 %e
  34.     var %s = $btc(Url:) $+(http://,$+($1,$iif($2 != /,$2))) - $btc(Title:) $ptc($regml(1)) $iif($4,$4)
  35.     if ((!$istok(%dontparsetitles,$ptc($regml(1)),44)) && (*powerbot.org/vb/showthread.php?t=* !iswm $+(http://,$+($1,$iif($2 != /,$2))))) {
  36.       echo -a 12[4 $+ $3 $+ 12]10 $iif(c isincs $chan($3).mode,$strip(%s),%s) 12By4 %urlnick 10on12 %urlnetwork
  37.     }
  38.     unset $+(%,$(%z,2))
  39.     .sockclose %z
  40.   }
  41.   if (*HTTP*302* iswm %x) set -e %web.tmp 1
  42.   if (Location: isin %x) {
  43.     if ($mtc(%x)) {
  44.       tokenize 32 %e
  45.       sockclose %z
  46.       soc $regml(web,1) $iif($regml(web,2),$v1,/) $iif($3,$3,1) %z $iif(%web.tmp,Redirected)
  47.       unset %web.tmp
  48.     }
  49.   }
  50. }
  51. on *:sockclose:website.*: unset $+(%,$sockname)
  52. alias -l soc {
  53.   var %x = $iif($4,$4,$+(website.,$r(a,z),$r(a,z),$r(a,z),$r(0,9),$r(0,9),$r(0,9)))
  54.   set -e $+(%,%x) $1-2 $iif($3 ischan && $me ison $3,$3) $iif($5,$ntc($5))
  55.   sockopen %x $1 80
  56. }
  57. alias -l mtc return $regex(web,$1,/(?:https?:\/\/)?((?:www\.)?[\w-.]+\.(?>[a-z]{2,4})(?![a-z]))([\w-_#?=%.\/&?]+)?/ig)
  58. alias -l ptc return $replacecs($1,&mdash;,-,&quot;,",&amp;,&,&lt;,<,&gt;,>,�,$chr(233),�,$chr(231),&ccedil;,$chr(231),&ntilde;,$chr(241),�,$chr(209),�,$chr(220),�,$chr(244))
  59. alias -l btc return $+($chr(2),$1,$chr(2))
  60. alias -l ntc return $+($chr(40),$1,$chr(41))
  61. alias rtc {
  62.   if (*youtube.com* !iswm $1-) {
  63.     if ($mtc($2-)) && (!%website.flood [ $+ [ $regml(web,1) ] ]) {
  64.       set %urlnick $nick
  65.       set %urlnetwork $network
  66.       var %x = 1, %v
  67.       while ($regml(web,%x)) {
  68.         var %z = $iif(/ isin $regml(web,$calc(%x +1)),$v2,/), %i = $regml(web,%x)
  69.         if (/ !isin %i) && (!$istok(%v,%i,32)) {
  70.           soc %i %z $1
  71.           %v = %v %i
  72.         }
  73.         inc %x 1
  74.       }
  75.       set -eu5 %website.flood $+ $regml(web,1) 1
  76.     }
  77.   }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement