Advertisement
westor

/IPL - IP Lookup addon for JuanAM

Nov 17th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.31 KB | None | 0 0
  1. alias ipl {
  2.   if (!$1) { echo -a 10 You must enter the IP address to find, in this format 12 $+ /ip 111.111.111.111 | return }
  3.   if ($remove($1,.) !isnum) { echo -a Error: Your IP address is not correct, try again! | return }
  4.   var %s = InfoIP_ $+ $ticks $+ _ $+ $rand(1,10000000)
  5.   if ($sock(%s)) { sockclose %s }
  6.   echo -a ***** Searching information for IP:  $+ $1 $+  *****
  7.   sockopen %s geoip.flagfox.net 80
  8.   sockmark %s $1
  9. }
  10.  
  11. ON *:SOCKOPEN:InfoIP_*: {
  12.   if ($sockerr) { echo -a ERROR: Connection problem, Could not connect to the page! | sockclose $sockname | return }
  13.   sockwrite -nt $sockname GET /?ip= $+ $sock($sockname).mark HTTP/1.1
  14.   sockwrite -nt $sockname Host: $sock($sockname).addr
  15.   sockwrite -nt $sockname Connection: close
  16.   sockwrite -nt $sockname $crlf
  17. }
  18.  
  19. ON *:SOCKREAD:InfoIP_*: {
  20.   if ($sockerr) { echo -a ERROR: Connection reading problem, Could not read from the page! | sockclose $sockname | return }
  21.   var %r
  22.   sockread %r
  23.   var %r = $remove(%r,$chr(9),$chr(10),$chr(13))
  24.   ; echo -a READ: %r
  25.   if ($sockbr == 0) { return }
  26.   if (*span class="font"><a href="http://whois.domaintools.com/* iswm %r) { echo -a 12Hostname:1 $httpstrip(%r) $+  }
  27.   if (*<a href="http://en.wikipedia.org/wiki/* iswm %r) && ($left(%r,2) == <a) && (*target="_blank" title="Wikipedia entry for* iswm %r) { echo -a 12Continent:1 $httpstrip(%r) $+  }
  28.   if (*<span style="white-space: nowrap"><a href="http://en.wikipedia.org/wiki/* iswm %r) && (*target="_blank" title="* iswm %r) { echo -a 12Country:1 $httpstrip(%r) $+  }
  29.   if (*<span class="dim">* isin %r) { echo -a 12City:1 $httpstrip(%r) $+  }
  30.   if (*<span class="smallfont">* iswm %r) && ($numtok(%r,60) == 1) { echo -a 12ISP:1 $httpstrip(%r) $+  }
  31.   if (*['_setCustomVar', 2, 'Country Code',* iswm %r) { echo -a 12Country Code:1 $remove($gettok(%r,4,44),') }
  32. }
  33.  
  34. ON *:SOCKCLOSE:InfoIP_*: { echo -a ***** End of  $+ $sock($sockname).mark $+  IP lookup! ***** }
  35.  
  36. alias httpstrip {
  37.   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))
  38.   var %x = $remove(%xx,<![CDATA[,]]>,$chr(2),$chr(4),$chr(9),$chr(31),$chr(22),$chr(29),$chr(10),$chr(13))
  39.   var %i = $regsub(%x,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
  40.   return %x
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement