From 39df572ea4b5ece96355ca14ba0fd7db7c9aa269 Mon Sep 17 00:00:00 2001 From: Matt Weller Date: Sun, 7 Jul 2024 12:17:27 -0700 Subject: [PATCH] cleanup dangling print()s and adjust format slightly --- modules/bing.py | 1 - modules/tzone.py | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) 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."