[init] initial commit

This commit is contained in:
2023-06-05 23:04:30 +08:00
commit 66b1dd4d70
72 changed files with 10079 additions and 0 deletions

28
roll_api/get_self_ip.py Normal file
View File

@ -0,0 +1,28 @@
import requests
import json
def ip_self(app_id, app_secret):
api_url = f'https://www.mxnzp.com/api/ip/self?app_id={app_id}&app_secret={app_secret}'
res = requests.get(api_url)
res_http_code = res.status_code
res_text = json.loads(res.text)
res_code = res_text['code']
res_msg = res_text['msg']
if res_http_code != 200 or res_code == 0:
print(f"接口查询失败:{res_msg}\n")
else:
for key, value in res_text['data'].items():
print(key.strip().ljust(10), ':', end=' ')
print(str(value).strip())
def main():
app_id = "nrsngdkvknqkrwko"
app_secret = "SFFmQWo2dnNBRjdNYkVSclZxa2ZvUT09"
ip_self(app_id, app_secret)
if __name__ == '__main__':
main()