MCPcopy
hub / github.com/n0a/telegram-get-remote-ip / get_whois_info

Function get_whois_info

tg_get_ip.py:81–95  ·  view source on GitHub ↗

Retrieve whois data for the given IP.

(ip)

Source from the content-addressed store, hash-verified

79 return None
80
81def get_whois_info(ip):
82 """Retrieve whois data for the given IP."""
83 try:
84 response = requests.get(f"http://ip-api.com/json/{ip}")
85 data = response.json()
86
87 # Get the hostname using the socket library
88 hostname = get_hostname(ip)
89 if hostname:
90 print(f"[+] Hostname: {hostname}")
91
92 return data
93 except Exception as e:
94 print(f"[!] Error fetching whois data: {e}")
95 return None
96
97
98def display_whois_info(data):

Callers 2

mainFunction · 0.85

Calls 1

get_hostnameFunction · 0.85

Tested by

no test coverage detected