feat: 添加多个功能模块和工具脚本
- 新增websocket客户端和服务端实现 - 添加图片压缩工具和快速压缩脚本 - 实现学生信息处理相关API - 添加MQTT客户端和消息处理功能 - 更新.gitignore忽略更多文件类型 - 添加数据库操作工具和示例 - 实现多个测试脚本和工具类
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
from requests import get, post, put, delete
|
||||
import random
|
||||
|
||||
|
||||
# v1.jinrishici.com/all.json
|
||||
def apiSentence():
|
||||
data = get("https://v1.hitokoto.cn").json()
|
||||
return data
|
||||
|
||||
|
||||
def cat():
|
||||
data = get("https://api.thecatapi.com/v1/images/search?size=full").json()
|
||||
result = data[0]["url"]
|
||||
return result
|
||||
|
||||
|
||||
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([ pic])
|
||||
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
|
||||
Reference in New Issue
Block a user