From 53efd1467a44bb4208a02eb7d9b7f2f58d772154 Mon Sep 17 00:00:00 2001 From: PeterLaemmle Date: Mon, 29 Oct 2018 16:19:12 +0100 Subject: [PATCH] Update Telegram.py Pleasing the Codacy BOT ;-) --- plugins/Telegram/Telegram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Telegram/Telegram.py b/plugins/Telegram/Telegram.py index 05f9887..2120d75 100644 --- a/plugins/Telegram/Telegram.py +++ b/plugins/Telegram/Telegram.py @@ -107,10 +107,10 @@ def run(typ,freq,data): RoutingOrigin, "&destination=", address, "&mode=driving&key=", GoogleAPIKey]) response = json.loads(requests.get(url).content.decode('utf-8')) logging.debug("Directions API return status: %s" % response['status']) - + # Retrieve static maps using Google API logging.debug("Retrieve maps from Google") - url = "".join(["https://maps.googleapis.com/maps/api/staticmap?&size=480x640&maptype=roadmap&language=de&path=enc:", - response['routes'][0]['overview_polyline']['points'], "&key=", GoogleAPIKey]) + url = "".join(["https://maps.googleapis.com/maps/api/staticmap?&size=480x640&maptype=roadmap&path=enc:", + response['routes'][0]['overview_polyline']['points'], "&language=de&key=", GoogleAPIKey]) with open("overview_map.png", "wb") as img: img.write(requests.get(url).content) url = "".join(["https://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=240x320&scale=2&maptype=hybrid&zoom=17&language=de&key=", GoogleAPIKey])