http://forum.egghelp.org/viewtopic.php?t=20844 << this page
Code: Select all
package require http
package require json
set ExpChan "#opers"
bind raw - NOTICE Client_Connect
proc Client_Connect {from key arg} {
if {[string match *!*@* $from] || ![string match -nocase "*client connecting*" $arg]} { return }
if {[scan $arg %\[^\:\]\:%\[^(\](%\[^@\]@%\[^\)\] _ nick ident host] == "4"} {
set token [http::geturl http://ip-api.com/json/$host?fields=status,city,isp,country,query,regionName,countryCode]
set data [json::json2dict [http::data $token]]
::http::cleanup $token
if {[dict get $data status] eq "success"} {
puthelp "PRIVMSG $::ExpChan :\002Nick\002: $nick - \002IP\002: [dict get $data query] - \002Country\002: [dict get $data country] -\
\002City\002: [dict get $data city] - \002ISP\002: [dict get $data isp] [dict get $data countryCode]"
} else {
putcmdlog "Error! it fails to get data for this $host"
}
}
return 0
}
The ip.
Would be super appreciated if someone could edit this to do so, Thanks in advanced