def google_map(message, keywords):
"""
google ?????????????
https://github.com/llimllib/limbo/blob/master/limbo/plugins/map.py
"""
query = quote(keywords)
# Slack seems to ignore the size param
#
# To get google to auto-reasonably-zoom its map, you have to use a marker
# instead of using a "center" parameter. I found that setting it to tiny
# and grey makes it the least visible.
url = "https://maps.googleapis.com/maps/api/staticmap?size=800x400&markers={0}&maptype={1}"
url = url.format(query, 'roadmap')
botsend(message, url)
attachments = [{
'pretext': '<http://maps.google.com/maps?q={}|????????>'.format(query),
'mrkdwn_in': ["pretext"],
}]
botwebapi(message, attachments)
评论列表
文章目录