mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Before worked, now have been changed the URL and fails:
URL before: www.geoip.com
URL now: www.geoiptool.com

Code:
;.................more stuff.................
alias ipl {
  var %s = InfoIP_ $+ $ticks $+ _ $+ $rand(1,10000000)
  if ($sock(%s)) { sockclose %s }
  .timer[ $+ %s $+ ] 1 10 ipl_error %s $1
  echo -at ***** Buscando información de la IP:  $+ $1 $+  *****
  sockopen %s geoiptool.com 80
  sockmark %s $1
}

ON *:SOCKOPEN:InfoIP_*: {
  if ($sockerr) { echo -at Error:Problema de conexión, no se pudo conectar a la página! | sockclose $sockname | return }
  sockwrite -nt $sockname GET /?ip= $+ $sock($sockname).mark HTTP/1.1
  sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
  sockwrite -nt $sockname Accept-Language: es-es,es
  sockwrite -nt $sockname Host: $sock($sockname).addr
  sockwrite -nt $sockname Connection: close
  sockwrite -nt $sockname $crlf
}

ON *:SOCKREAD:InfoIP_*: {
  if ($sockerr) { echo -at 7,12Error: 11,12Problema de de conexión, no se puede leer desde la página! | sockclose $sockname | return }
  var %r
  sockread %r
  var %r = $remove(%r,$chr(9),$chr(10),$chr(13))
  ; for debuggin purpose  
echo -at READ: %r
  if ($sockbr == 0) { return }
;.................more stuff.................


ERROR:
Quote:

07:11 ***** Buscando información de la IP: 167.35.15.149 *****
07:11 READ: HTTP/1.1 301 Moved Permanently
07:11 READ: Server: nginx/1.6.2
07:11 READ: Date: Thu, 12 Nov 2015 10:11:06 GMT
07:11 READ: Content-Type: text/html
07:11 READ: Content-Length: 184
07:11 READ: Connection: close
07:11 READ: Location: https://geoiptool.com/?ip=167.35.15.149
07:11 READ:
07:11 READ: <html>
07:11 READ: <head><title>301 Moved Permanently</title></head>
07:11 READ: <body bgcolor="white">
07:11 READ: <center><h1>301 Moved Permanently</h1></center>
07:11 READ: <hr><center>nginx/1.6.2</center>
07:11 READ: </body>
07:11 READ: </html>
07:11 ***** Final de información de la IP: 167.35.15.149 *****

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
It's a SSL page so try port 443 instead of 80

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Also use /sockopen -e when using SSL


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Nov 2014
Posts: 149
J
JuanAm Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Originally Posted By: westor
Also use /sockopen -e when using SSL


Thank sakana and westor it worked!
The only way it worked for me was:
Code:
sockopen -e %s geoiptool.com 443


Link Copied to Clipboard