forked from huaisha1224/jd-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshimo.py
More file actions
52 lines (46 loc) · 1.29 KB
/
shimo.py
File metadata and controls
52 lines (46 loc) · 1.29 KB
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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
提交数据到石墨文档
"""
import requests
import random
def shimo(content):
"""提交数据到石墨文档表单收集器
"""
# 石墨文档提交数据格式
data = {
"duration" : 55, #时间
"formRev" : 1,
"responseContent" : [
{
"guid" : "xxxxx", #石墨文档的guid
"text" : {
"content" : "xxxxxxxx"
},
"type" : 0
}
],
"userFinger" : "-1",
"userName" : "JD"
}
url = "https://shimo.im/api/newforms/forms/xpVxJQJjT3GJ8WhJ/submit"
data['duration'] = random.randint(20,40) #生成随机时间
data['responseContent'][0]['text']['content'] = content
data['userName'] = "JD助手"
# print("Duration: ", data['duration'])
# print("userName: ",data['userName'])
# print("Content: ", data['responseContent'][0]['text']['content'])
# print(data)
response = requests.post(url, json=data) #用post方式提交数据
if response.status_code == 200 or 204:
#print(response.status_code)
return True
else:
return False
if __name__ == '__main__':
vercode = ['7102298241802','1369696304672','5557372871652']
for x in vercode:
shimo(x)
# ok = shimo(x)
# print(ok)