def checkDayAndSendMail():
todayDate = datetime.now()
start = datetime(todayDate.year, todayDate.month, todayDate.day)
end = start + timedelta(days=1)
global dateIndex
# if change date
if dateIndex < end :
dateIndex = end
# send mail notifying server still working
msg_content = {}
msg_content['Subject'] = '[Amazon Price Alert] Server working !'
msg_content['Content'] = 'Amazon Price Alert still working until %s !' % (todayDate.strftime('%Y-%m-%d %H:%M:%S'))
msg_content['Price'] = ""
msg_content['Time'] = todayDate.strftime('%Y-%m-%d %H:%M:%S')
msg_content['ServerState'] = "Working"
msg_content['code'] = 2 # 2 is server state
send_Notification(msg_content)
评论列表
文章目录