Update Telegram.py

- Remove redundant concatenation
- Ensure German descriptions in maps
This commit is contained in:
PeterLaemmle 2018-10-19 17:45:03 +02:00 committed by GitHub
parent de7947bec7
commit 203bbedaa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,9 +100,9 @@ def run(typ,freq,data):
address = "+".join(data["msg"].split(')')[0].split('/',1)[1].replace('(',' ').split())
logging.debug("Retrieve maps from Google")
url = "+".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=480x640&maptype=roadmap&zoom=16&key=", GoogleAPIKey])
url = "".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=480x640&maptype=roadmap&zoom=16&language=de&key=", GoogleAPIKey])
urllib.urlretrieve(url, "overview_map.png")
url = "+".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=240x320&scale=2&maptype=hybrid&zoom=17&key=", GoogleAPIKey])
url = "".join(["http://maps.googleapis.com/maps/api/staticmap?markers=", address, "&size=240x320&scale=2&maptype=hybrid&zoom=17&language=de&key=", GoogleAPIKey])
urllib.urlretrieve(url, "detail_map.png")
# Send message and map with Telegram