def post_comments_to_mapillary(entries):
global mapillary_client_id
global mapillary_access_token
global user_agent
global time_out
for e in entries:
msg = "This image was mentioned on OpenStreetMap at https://www.openstreetmap.org/" + e.osmtype + "/" + e.osmid + " by user '" + e.osmuser + "'. Message generated by https://github.com/ltog/mapillary-osm-usage-notification-bot ."
url = "https://a.mapillary.com/v2/im/" + e.mapillaryid + "/cm?client_id=" + mapillary_client_id
payload = {"cm": msg}
r = backoff_post(url, payload)
logging.info("Posting comment for image " + e.mapillaryid + " resulted in HTTP status " + str(r.status_code) + " and response: " + r.text)
if r.status_code == 200:
log_success(str(e))
if r.status_code == 404:
logging.warning("Entry " + str(e) + "generated HTTP error 404 for URL " + url + " . ")
log_failure(str(e))
mounb.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录