A simple IP to Country
A simple non-socket ip to country that will return a country name based on ip.
;----------------------------------------------------------------------
; Author : bruas aka biase @ Webchat, unclean @ DalNet, Lite @ KampungChat
; Name : A simple IP to Country
; URL : -
; Description : A simple non-socket ip to country that will return a country name based on ip.
; : It will trigger when a user use like this $ip2country(<ip>).
; Example : //echo $ip2country(216.58.196.46)
; Created : 1509274412
;----------------------------------------------------------------------
alias ip2country {
if ($longip($1)) {
var %a ajax. $+ $regsubex($str(.,10),/./g,$mid($md5($time),$r(1,32),1))
.comopen %a msxml2.xmlhttp
noop $com(%a,send,$com(%a,open,1,bstr,GET,bstr,$+(http://geoip.nekudo.com/api/,$1),bool,true))
.comclose %a $com(%a,ResponseText,2) $regex($com(%a).result,/"name":"(.+?)"\54/)
}
return $iif($regml(1),$v1)
}
;----------------------------------------------------------------------
; Author : bruas aka biase @ Webchat, unclean @ DalNet, Lite @ KampungChat
; Name : A simple IP to Country
; URL : -
; Description : A simple non-socket ip to country that will return a country name based on ip.
; : It will trigger when a user use like this $ip2country(<ip>).
; Example : //echo $ip2country(216.58.196.46)
; Created : 1509274412
;----------------------------------------------------------------------
alias ip2country {
if ($longip($1)) {
var %a ajax. $+ $ticks | .comopen %a msxml2.xmlhttp
noop $com(%a,send,$com(%a,open,1,bstr,GET,bstr,$+(http://ip-api.com/line/,$1,?fields=country),bool,true))
.comclose %a $com(%a,ResponseText,2) $regex(ip2c,$com(%a).result,(.+))
}
return $regml(ip2c,1)
}
Here is the new update.. enjoy~
yea... and sorry i not really an active mirc user..