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