Added comment

pull/182/head
M66B 4 years ago
parent 28880d2a57
commit 797985849a

@ -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");

Loading…
Cancel
Save