[init] initial commit
This commit is contained in:
1
roll_api/calendar_tips.py
Symbolic link
1
roll_api/calendar_tips.py
Symbolic link
@ -0,0 +1 @@
|
||||
/opt/scripts/alert/calendar_tips.py
|
45
roll_api/domain_reg_check.py
Normal file
45
roll_api/domain_reg_check.py
Normal file
@ -0,0 +1,45 @@
|
||||
import base64
|
||||
import sys
|
||||
import time
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
def reg_check(app_id, app_secret, domain):
|
||||
api_url = f'https://www.mxnzp.com/api/beian/search?domain={domain}&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(res_msg)
|
||||
exit(3)
|
||||
else:
|
||||
# print(res_text)
|
||||
print("*" * 50)
|
||||
print(f"域 名:{res_text['data']['domain']}")
|
||||
print(f"单 位:{res_text['data']['unit']}")
|
||||
print(f"类 型:{res_text['data']['type']}")
|
||||
print(f"备案号:{res_text['data']['icpCode']}")
|
||||
print(f"名 称:{res_text['data']['name']}")
|
||||
print(f"审核时间:{res_text['data']['passTime']}\n")
|
||||
|
||||
|
||||
def main():
|
||||
app_id = "nrsngdkvknqkrwko"
|
||||
app_secret = "SFFmQWo2dnNBRjdNYkVSclZxa2ZvUT09"
|
||||
if len(sys.argv) == 1:
|
||||
print("Must specify one or more domains to check registration.")
|
||||
exit(2)
|
||||
|
||||
for domain in sys.argv[1:]:
|
||||
domain = str(base64.b64encode(domain.encode('utf-8')), encoding='utf-8')
|
||||
reg_check(app_id, app_secret, domain)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
45
roll_api/get_ip.py
Normal file
45
roll_api/get_ip.py
Normal file
@ -0,0 +1,45 @@
|
||||
import sys
|
||||
import json
|
||||
import requests
|
||||
import time
|
||||
|
||||
|
||||
def ip_check(app_id, app_secret, ip):
|
||||
api_url = f"https://www.mxnzp.com/api/ip/aim_ip?ip={ip}&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}")
|
||||
else:
|
||||
print('*' * 50)
|
||||
for key, value in res_text['data'].items():
|
||||
print(key.strip().ljust(10), ':', end=' ')
|
||||
print(str(value).strip())
|
||||
print()
|
||||
|
||||
|
||||
def main():
|
||||
app_id = "nrsngdkvknqkrwko"
|
||||
app_secret = "SFFmQWo2dnNBRjdNYkVSclZxa2ZvUT09"
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print("Must specify at least one IP for information check.")
|
||||
exit(2)
|
||||
|
||||
# try:
|
||||
# ip = sys.argv[1]
|
||||
# except Exception as Err:
|
||||
# print(f"Error Desc: {Err}. Maybe you need to supply correct ip next time.")
|
||||
# exit(2)
|
||||
|
||||
for ip in sys.argv[1:]:
|
||||
ip_check(app_id, app_secret, ip)
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
28
roll_api/get_self_ip.py
Normal file
28
roll_api/get_self_ip.py
Normal 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()
|
||||
|
1
roll_api/love_words.py
Symbolic link
1
roll_api/love_words.py
Symbolic link
@ -0,0 +1 @@
|
||||
/opt/scripts/alert/love_words.py
|
1
roll_api/weather_tips.py
Symbolic link
1
roll_api/weather_tips.py
Symbolic link
@ -0,0 +1 @@
|
||||
/opt/scripts/alert/weather_tips.py
|
Reference in New Issue
Block a user