From edde1256db17aabdd9a90fff97ccb8dbf543c6cc Mon Sep 17 00:00:00 2001 From: 62918bc062e94773587808ef <62918bc062e94773587808ef@devide> Date: Mon, 1 May 2023 13:48:00 +0000 Subject: [PATCH] Mon May 1 13:48:00 UTC 2023 inscode --- main.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4c0c135..cb25f53 100644 --- a/main.py +++ b/main.py @@ -1 +1,18 @@ -print('欢迎来到 InsCode') \ No newline at end of file +# 导入requests库 +import requests +import json +from tabulate import tabulate +import wcwidth +# 向指定的url发送get请求 +response = requests.get('https://ul.ztrztr.top/api/u') + +# 打印response的文本内容 +print(response.text) + +# 将response的内容解析为json格式,然后将其转换为字符串格式 +json_data = json.loads(response.text) +json1 = json.dumps(json.loads(response.text), indent=4, sort_keys=False, ensure_ascii=False) + +ultraMobs = ["Queen Ant", "Queen Fire Ant", "Leech", "Ladybug", "Sandstorm", "Roach", "Crab", "Spider", "Moth", "Centipede", "Fly", "Hornet", "Crab", "Shell", "Jellyfish", "Rock", "Beetle", "Bubble", "Dandelion", "Cactus", "Hel Beetle", "Termite Overmind"] +for i in ultraMobs : + print(i + ":" + json_data.get("Name: " + i + " Server: NA", "N/A")) \ No newline at end of file -- GitLab