diff --git a/modules/bing.py b/modules/bing.py index e91b2eb..a07db7d 100644 --- a/modules/bing.py +++ b/modules/bing.py @@ -3,7 +3,6 @@ class Bing: - print("instantiating Bing...") # from modules.bing_credentials import BingCredentials as bc try: from modules.bing_credentials import BingCredentials as bc diff --git a/modules/tzone.py b/modules/tzone.py index 503ab28..969d0c8 100644 --- a/modules/tzone.py +++ b/modules/tzone.py @@ -51,14 +51,10 @@ def request_api(self, location): lat, long = b.get_lat_long_from_bing(location) url_query = None try: - headers = { - 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', - } url_query = self.url + "?latitude=" + str(lat) + "&longitude=" + str(long) r = requests.get(url_query) j = json.loads(r.text) - print(json.dumps(j, indent=2)) - local_time = j["current_local_datetime"].split("T")[-1] + local_time = j["current_local_datetime"].replace("T", " ") return str(location + ", (assumed to be timezone " + j["iana_timezone"] + ", " + j["offset"] + "): " + local_time) except IndexError: return "Not a valid request, try again."