refactor: demo agent (#81)

This commit is contained in:
sigoden
2024-07-29 17:26:36 +08:00
committed by GitHub
parent 226228dfa4
commit 213d1b3fd7
7 changed files with 73 additions and 47 deletions
+6 -8
View File
@@ -1,11 +1,9 @@
import os
import platform
import urllib.request
def get_sysinfo():
def get_ipinfo():
"""
Get the system info
Get the ip info
"""
return "\n".join([
f"OS: {platform.system()}",
f"Arch: {platform.machine()}",
])
with urllib.request.urlopen("https://httpbin.org/ip") as response:
data = response.read()
return data.decode('utf-8')