update zhaoan
This commit is contained in:
parent
5989d46349
commit
78d33c4ef5
2 changed files with 40 additions and 4 deletions
|
@ -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
|
||||
|
|
36
zaoan.py
Normal file
36
zaoan.py
Normal file
|
@ -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))
|
Loading…
Reference in a new issue