代码拉取完成,页面将自动刷新
import config
import getApi
# 早安的json数据
def getmoring_json(data_list):
# 数据整合
to_user = data_list[0]
day = data_list[1]
wek = data_list[2]
wea = data_list[3]
birthday = data_list[4]
lovedays = data_list[5]
city_name = data_list[6]
type = data_list[7]
max = data_list[8]
min = data_list[9]
content = getApi.getEvDayZaoAn()
data_baby = {
"touser": to_user,
"template_id": config.template_id.get("id_forBaby"),
"url": "https://m.tianqi.com/",
"topcolor": "#FF0000",
"data": {
"content":
{
"value": content,
"color": "#000000"
},
"date":
{
"value": "今天是" + "{} {}".format(day, wek),
"color": "#8470FF"
},
"city": {
"value": "城市:" + city_name,
"color": "#808A87"
},
"weather": {
"value": "天气:" + wea,
"color": "#ED9121"
},
"min_temperature": {
"value": "最低气温:" + min,
"color": "#00FF00"
},
"max_temperature": {
"value": "最高气温" + max,
"color": "#FF6100"
},
"love_day": {
"value": "今天是我们恋爱的第" + lovedays + "天",
"color": "#FFC0CB"
},
"birthday": {
"value": "距离小宝的生日还有" + birthday + "天",
"color": "#FF8000"
}
}
}
data_user = {
"touser": to_user,
"template_id": config.template_id.get("id_forUser"),
"url": "https://m.tianqi.com/",
"topcolor": "#FF0000",
"data": {
"content":
{
"value": content,
"color": "#000000"
},
"date": {
"value": "今天是" + "{} {}".format(day, wek),
"color": "#8470FF"
},
"city": {
"value": "城市:" + city_name,
"color": "#808A87"
},
"weather": {
"value": "天气:" + wea,
"color": "#ED9121"
},
"min_temperature": {
"value": "最低气温:" + min,
"color": "#00FF00"
},
"max_temperature": {
"value": "最高气温" + max,
"color": "#FF6100"
}
}
}
if type == "baby":
return data_baby
else:
return data_user
# 晚安的json数据
def getNight_json(to_user, type):
content = getApi.getEvDayWanAn()
data_baby = {
"touser": to_user,
"template_id": config.template_id_n.get("id_forBaby"),
"url": "https://music.163.com/",
"topcolor": "#FF0000",
"data": {
"content":
{
"value": content,
"color": "#000000"
},
"like":
{
"value": "时间过得真快 我们在一起的时间又多了一天,晚安宝贝",
"color": "#000000"
}
}
}
data_user = {
"touser": to_user,
"template_id": config.template_id_n.get("id_forUser"),
"url": "https://music.163.com/",
"topcolor": "#FF0000",
"data": {
"content":
{
"value": content,
"color": "#000000"
},
}
}
if type == "baby":
return data_baby
else:
return data_user
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。