def get_system_status():
session_attributes = {}
card_title = "BART System Status"
reprompt_text = ""
should_end_session = False
response = urllib2.urlopen(API_BASE + "/status")
bart_system_status = json.load(response)
speech_output = "There are currently " + bart_system_status["traincount"] + " trains operating. "
if len(bart_system_status["message"]) > 0:
speech_output += bart_system_status["message"]
else:
speech_output += "The trains are running normally."
return build_response(session_attributes, build_speechlet_response(
card_title, speech_output, reprompt_text, should_end_session))
lambda_function.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录