From 27cb20fffed493690b1687e39ca2fc0ad866bf20 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Wed, 13 Jan 2021 09:50:36 +0800 Subject: [PATCH] update zhaoan --- worker/zhaoan.py | 8 ++++---- zaoan.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 zaoan.py diff --git a/worker/zhaoan.py b/worker/zhaoan.py index df98571..678e2f7 100644 --- a/worker/zhaoan.py +++ b/worker/zhaoan.py @@ -46,7 +46,7 @@ def getWeather(id='101120206'): def calendar(): - ymc = ["十一", "十二", "正", "二", "三", "四", "五", "六", "七", "八", "九", "十"] + ymc = ["冬", "腊", "正", "二", "三", "四", "五", "六", "七", "八", "九", "十"] rmc = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十", "卅一"] zmc = ["一", "二", "三", "四", "五", "六", "天"] @@ -54,16 +54,16 @@ def calendar(): y = nowdate.year m = nowdate.month d = nowdate.day - zc = int(nowdate.strftime("%W")) - 34 + zc = int(nowdate.strftime("%W")) - 1 z = zmc[nowdate.weekday()] lunar = sxtwl.Lunar() lunarday = lunar.getDayBySolar(y, m, d) - lunardaychinese = f"{ymc[lunarday.Lmc]}月{rmc[lunarday.Ldi]}日" + lunardaychinese = f"{ymc[lunarday.Lmc]}月{rmc[lunarday.Ldi]}" if lunarday.Lleap: lunardaychinese = "闰" + lunardaychinese - cal = f"{m}月{d}日,农历{lunardaychinese},本学期第{zc}周,星期{z}" + cal = f"{m}月{d}日,{lunardaychinese},寒假第{zc}周,星期{z}" return cal diff --git a/zaoan.py b/zaoan.py new file mode 100644 index 0000000..80b40f3 --- /dev/null +++ b/zaoan.py @@ -0,0 +1,36 @@ +import requests +import json + +url = 'http://127.0.0.1:5580/' +headers = {'Content-Type': 'application/json'} + +gids = [743539576, 959613860, 1107535671] + +data = { + "anonymous": "None", + "font": 1501544, + "group_id": 959613860, + "message": "/zhaoan", + "message_id": 2071, + "message_type": "group", + "post_type": "message", + "raw_message": "/zhaoan", + "self_id": 161795000, + "sender": { + "age": 18, + "area": "济宁", + "card": "", + "level": "活跃", + "nickname": "SiHuan", + "role": "owner", + "sex": "unknown", + "title": "", + "user_id": 1318000000 + }, + "sub_type": "normal", + "time": 1582805370, + "user_id": 1318000000 +} +for gid in gids: + data['group_id'] = gid + requests.post(url=url, headers=headers, data=json.dumps(data)) \ No newline at end of file