🚧 Work in progress

This commit is contained in:
Alicia Sykes
2022-07-19 13:14:16 +01:00
parent 9018f6fdd1
commit a745e28388
5 changed files with 93 additions and 2 deletions

View File

@@ -117,6 +117,26 @@ const Results = (): JSX.Element => {
fetchShodanData();
}
}, [ipAddress]);
/* Get WhoIs info for a given domain name */
useEffect(() => {
const applyWhoIsResults = (response: any) => {
console.log('WhoIs Response', response);
}
const fetchWhoIsData = () => {
const apiKey = keys.whoApi;
fetch(`https://api.whoapi.com/?domain=${address}&r=whois&apikey=${apiKey}`)
.then(response => response.json())
.then(response => {
if (!response.error) applyWhoIsResults(response)
})
.catch(err => console.error(err));
};
if (addressType === 'url') {
fetchWhoIsData();
}
}, [addressType, address]);
return (
<ResultsOuter>