XZZ/worker/icp.py

28 lines
1.1 KiB
Python
Raw Permalink Normal View History

2021-11-13 19:26:56 +08:00
from zzcore import StdAns
import requests
class Ans(StdAns):
def GETMSG(self):
2021-11-13 20:07:24 +08:00
r = requests.get(url='https://api.oick.cn/icp/api.php?url=' + str(self.parms[1]).lower()).json()
if r['code'] == '200':
organizer_name = r['主办单位名称']
organizer_nature = r['主办单位性质']
recording_license_number = r['网站备案/许可证号']
site_name = r['网站名称']
if r['网站首页网址'] == '':
2021-11-13 19:26:56 +08:00
site_index_url = ''
else:
2021-11-13 20:07:24 +08:00
site_index_url = '网站首页地址:' + r['网站首页网址']
2021-11-13 19:26:56 +08:00
msg = '主办单位名称:' + organizer_name + '\n' + \
'主办单位性质:' + organizer_nature + '\n' + \
'网站备案/许可证号:' + recording_license_number + '\n' + \
'网站名称:' + site_name + '\n' + \
site_index_url
2021-11-13 20:07:24 +08:00
elif r['code'] == 201:
msg = '未有此域名ICP备案记录!'
elif r['code'] == 202:
msg = '域名不能为空!'
2021-11-13 19:26:56 +08:00
return msg