Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (27 sloc) 838 Bytes
/* returned object keys
ip
city
country
countryCode
region
regionCode
isp
lat
long
asn
tz (timezone)
zip (postal code)
utcOffset
countryCallCode
currency
languages (CSV)
*/
externalIP(ip:=""){
ipInfoList:={ip:"ip",city:"city",country:"country_name",countryCode:"country",region:"region",regionCode:"region_code",isp:"org",lat:"latitude",long:"longitude",asn:"asn",tz:"timezone",zip:"postal",utcOffset:"utc_offset",countryCallCode:"country_calling_code",currency:"currency",languages:"languages"}
ipPage:=urlDownloadToVar("https://ipapi.co/" . (ip?ip . "/":"") . "json")
for i,a in ipInfoList{
regExMatch(ipPage,"Um)""" . a . """: ""?\K[^"",]+(?=""|,)",t)
ipInfoList[i]:=t
}
return ipInfoList
}
You can’t perform that action at this time.