From 3fce209a997914e596740104e47895e2ddd12ebb Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 28 Apr 2019 15:38:26 +0100 Subject: Change location.py to use lat/lon instead of continent/country/city --- modules/location.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modules/location.py') diff --git a/modules/location.py b/modules/location.py index 85e147da..284ee3ad 100644 --- a/modules/location.py +++ b/modules/location.py @@ -16,10 +16,7 @@ class Module(ModuleManager.BaseModule): if page and page.data["results"]: result = page.data["results"][0] timezone = result["annotations"]["timezone"]["name"] - continent = result["components"]["continent"] - country = result["components"]["country"] - city = result["components"]["city"] + lat = result["geometry"]["lat"] + lon = result["geometry"]["lng"] - print("yes") - return {"timezone": timezone, "continent": continent, - "country": country, "city": city} + return {"timezone": timezone, "lat": lat, "lon": lon} -- cgit v1.3.1-10-gc9f91