🚧 Work in progress
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -8,7 +8,7 @@ export type AddressType = 'ipV4' | 'ipV6' | 'url' | 'err' | 'empt';
|
||||
/* Checks if a given string looks like a URL */
|
||||
const isUrl = (value: string):boolean => {
|
||||
const urlRegex= new RegExp(''
|
||||
+ /(?:(?:(https?|ftp):)?\/\/)/.source
|
||||
// + /(?:(?:(https?|ftp):)?\/\/)/.source
|
||||
+ /(?:([^:\n\r]+):([^@\n\r]+)@)?/.source
|
||||
+ /(?:(?:www\.)?([^/\n\r]+))/.source
|
||||
+ /(\/[^?\n\r]+)?/.source
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
const keys = {
|
||||
shodan: process.env.SHODAN_API_KEY,
|
||||
whoApi: process.env.WHO_API_KEY,
|
||||
};
|
||||
|
||||
export default keys;
|
||||
|
||||
Reference in New Issue
Block a user