aboutsummaryrefslogtreecommitdiff
path: root/modules/ip_addresses.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-11 22:26:38 +0000
committerGravatar jesopo2018-12-11 22:26:38 +0000
commit793d234a0b924c0330e88f07f68b13559b42e4ac (patch)
tree90ecd3746a77e17da915f90ec057cb16ead82c05 /modules/ip_addresses.py
parentActually use `action_desc` in github.py.issues, so that we can see what things (diff)
signature
'utils.http.get_url' -> 'utils.http.request', return a Response object from
utils.http.request
Diffstat (limited to 'modules/ip_addresses.py')
-rw-r--r--modules/ip_addresses.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/ip_addresses.py b/modules/ip_addresses.py
index 1d1e262a..c4993bfe 100644
--- a/modules/ip_addresses.py
+++ b/modules/ip_addresses.py
@@ -34,19 +34,19 @@ class Module(ModuleManager.BaseModule):
:usage: <IP>
:prefix: GeoIP
"""
- page = utils.http.get_url(URL_GEOIP % event["args_split"][0],
+ page = utils.http.request(URL_GEOIP % event["args_split"][0],
json=True)
if page:
- if page["status"] == "success":
- data = page["query"]
- data += " | Organisation: %s" % page["org"]
- data += " | City: %s" % page["city"]
- data += " | Region: %s (%s)" % (page["regionName"],
- page["countryCode"])
- data += " | ISP: %s" % page["isp"]
- data += " | Lon/Lat: %s/%s" % (page["lon"],
- page["lat"])
- data += " | Timezone: %s" % page["timezone"]
+ if page.data["status"] == "success":
+ data = page.data["query"]
+ data += " | Organisation: %s" % page.data["org"]
+ data += " | City: %s" % page.data["city"]
+ data += " | Region: %s (%s)" % (page.data["regionName"],
+ page.data["countryCode"])
+ data += " | ISP: %s" % page.data["isp"]
+ data += " | Lon/Lat: %s/%s" % (page.data["lon"],
+ page.data["lat"])
+ data += " | Timezone: %s" % page.data["timezone"]
event["stdout"].write(data)
else:
event["stderr"].write("No geoip data found")