diff --git a/main.py b/main.py index 4c0c135f61696bcf42c375ca5ab62aa5b105afc8..cb25f539a252e20e0957c4ab82caea827c740389 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