Skip to content

Commit

Permalink
cleanup dangling print()s and adjust format slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
hlmtre committed Jul 7, 2024
1 parent b02226a commit 5957d0c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion modules/bing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions modules/tzone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 5957d0c

Please sign in to comment.