Added comment

This commit is contained in:
M66B 2020-06-24 11:29:13 +02:00
parent 28880d2a57
commit 797985849a
1 changed files with 12 additions and 0 deletions

View File

@ -81,6 +81,18 @@ public class IPInfo {
Organization organization = new Organization();
try {
String json = Helper.readStream(connection.getInputStream(), StandardCharsets.UTF_8.name());
/* {
"ip": "8.8.8.8",
"hostname": "dns.google",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
} */
JSONObject jinfo = new JSONObject(json);
organization.name = jinfo.optString("org");
organization.country = jinfo.optString("country");