chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本 2. 新增数据库操作、API调用工具 3. 新增Excel数据处理脚本 4. 新增弱密码检测脚本
This commit is contained in:
+29
-36
@@ -1,42 +1,35 @@
|
||||
from requests import get, post, put, delete
|
||||
import random
|
||||
from requests import get, post
|
||||
import time
|
||||
|
||||
ip = "http://192.168.0.209:8100"
|
||||
param = {
|
||||
"username": "zhongwei",
|
||||
"password": "123456a",
|
||||
"client_id": "client",
|
||||
"grant_type": "password",
|
||||
"client_secret": "123456",
|
||||
}
|
||||
data = get(url=f"{ip}/oauth/token", params=param).json()
|
||||
token = data["access_token"]
|
||||
header = {
|
||||
"content-type": "application/json",
|
||||
"authorization": f"Bearer {token}",
|
||||
}
|
||||
teamId = 110
|
||||
year = 2026
|
||||
month = 3
|
||||
|
||||
# v1.jinrishici.com/all.json
|
||||
def apiSentence():
|
||||
data = get("https://v1.hitokoto.cn").json()
|
||||
return data
|
||||
data1 = get(f"{ip}/classAttend/screen/summary", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
|
||||
print("summary:", data1, end="\n\n")
|
||||
|
||||
data2 = get(f"{ip}/classAttend/screen/dailyTrend", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
|
||||
print("dailyTrend:", data2, end="\n\n")
|
||||
|
||||
def cat():
|
||||
data = get("https://api.thecatapi.com/v1/images/search?size=full").json()
|
||||
result = data[0]["url"]
|
||||
return result
|
||||
data3 = get(f"{ip}/classAttend/screen/statusPie", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
|
||||
print("statusPie:", data3, end="\n\n")
|
||||
|
||||
data4 = get(f"{ip}/classAttend/screen/gradeRanking", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
|
||||
print("gradeRanking:", data4, end="\n\n")
|
||||
|
||||
def dog():
|
||||
data = get("https://api.thedogapi.com/v1/images/search?size=full").json()
|
||||
result = data[0]["url"]
|
||||
return result
|
||||
|
||||
|
||||
def pic():
|
||||
data = get("https://api.vvhan.com/api/bing?type=json&rand=sj").json()
|
||||
result = data["data"]["url"]
|
||||
return result
|
||||
|
||||
|
||||
def randomPic():
|
||||
func = random.choice([cat])
|
||||
data = func()
|
||||
return data
|
||||
|
||||
|
||||
def getEmoji():
|
||||
data = get("https://api.vvhan.com/api/emoji?type=json").json()
|
||||
return data
|
||||
|
||||
|
||||
def getShi():
|
||||
data = post("http://v1.jinrishici.com/all.json").json()
|
||||
return data
|
||||
data5 = get(f"{ip}/classAttend/screen/studentRanking", headers=header, params={"teamId": teamId, "year": year, "month": month}).text
|
||||
print("studentRanking:", data5, end="\n\n")
|
||||
|
||||
Reference in New Issue
Block a user