Drohende Verbesserungsvorschläge (fast) jeder Art (z.B. zur json/
Code: Select all
GeoIP() ; load object using the 'https://ipapi.co/' API
MsgBox % GeoIP.region ; your current IP's assigned region ..
MsgBox % GeoIP.org ; .. organisation
MsgBox % GeoIP.version ; .. version
MsgBox % GeoIP.ip ; .. value. Check https://ipapi.co/api/#introduction for details!
For k, v in GeoIP ; extract all assignments from the previously loaded GeoIP object
lst .= k ": " v "`n"
MsgBox % clipboard := lst ; display all assignments of your current IP
GeoIP("?") ; display GeoIP' help
Return
GeoIP(type:="") {
if (type = "?") || (type = "help")
help()
else {
Global GeoIP := {}
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.SetTimeouts(0, 5000, 5000, 100000) ; adjust timeouts accordingly. Default: (0, 30000, 30000, 600000)
whr.Open("GET","https://ipapi.co/csv/", False) ; optional output formats are: json, jsonp, xml, csv, yaml.
whr.Send()
Sleep 100
k := StrSplit(StrSplit(Trim(whr.ResponseText,"`n`r"),"`n").1,",") ; processing retrieved csv's 1st line
v := StrSplit(StrSplit(Trim(whr.ResponseText,"`n`r"),"`n").2,",") ; processing retrieved csv's 2nd line
Loop % k.Length()
GeoIP[Trim(k[A_Index],"`n`r")] := v[A_Index]
Return
}
}
help(){
MsgBox,
(%
Example:
Once 'GeoIP()' has been loaded you can get the
'timezone' of a PC's geographical location
using 'GeoIP.timezone' or 'GeoIP["timezone"]'
Ie 'MsgBox % GeoIP.timezone' possible output: 'Europe/Berlin'.
The following keys/options might be interesting as well.
asn
city
continent_code
country
country_area
country_calling_code
country_capital
country_code
country_code_iso3
country_name
country_population
country_tld
currency
currency_name
in_eu
ip
languages
latitude
longitude
org
postal
region
region_code
timezone
utc_offset
version
)
ExitApp
}
Dasselbe nochmal als Funktion: Auf zur
Peep -
Tags: external IPgeofencinglocationGeoIPtimezoneCountry Code
Wie identifiziert man/frau lat/long innerhalb eines Radius (zB um (d)einen Wohnort) zum GeoFencing? Werde hieraus nicht wirklich schlau: http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates