-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrun.py
64 lines (41 loc) · 1.42 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# getclass
import requests
def run():
headers = {
'Accept': 'application/vnd.github+json',
'Authorization': 'token 你的TOKEN',
}
data = '{"event_type": "class_1_2"}'
response = requests.post(f'https://api.github.com/repos/你的用户名/wx_weather_class_push/dispatches',
headers=headers, data=data)
# 云函数入口
def main_handler(event, context):
return run()
#####################################################################
# morning
import requests
def run():
headers = {
'Accept': 'application/vnd.github+json',
'Authorization': 'token 你的TOKEN',
}
data = '{"event_type": "morning"}'
response = requests.post(f'https://api.github.com/repos/你的用户名/wx_weather_class_push/dispatches',
headers=headers, data=data)
# 云函数入口
def main_handler(event, context):
return run()
#####################################################################
# eve
import requests
def run():
headers = {
'Accept': 'application/vnd.github+json',
'Authorization': 'token 你的TOKEN',
}
data = '{"event_type": "evening"}'
response = requests.post(f'https://api.github.com/repos/你的用户名/wx_weather_class_push/dispatches',
headers=headers, data=data)
# 云函数入口
def main_handler(event, context):
return run()