You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function displayTitle() {
console.clear();
displayTextWithEffect(redGradient(title), 50);
}
function askForIp() {
rl.question(chalk.red('\n[>] Adress IP Info : '), async (ipAddress) => {
await getIpInfo(ipAddress);
setTimeout(askForAnotherSearch, 5000); // Attendre 5 secondes avant de demander une nouvelle recherche
});
}
NOUVEAU
[13:21]
const ipInfoText =
Adresse IP : ${ipData.ip_address}
Pays : ${ipData.country}
Code du pays : ${ipData.country_code}
Région : ${ipData.region}
Ville : ${ipData.city}
Latitude : ${ipData.latitude}
Longitude : ${ipData.longitude}
Code postal : ${ipData.postal_code}
Fuseau horaire : ${ipData.timezone.name}
UTC décalage : ${ipData.timezone.offset || 'N/A'}
ISP : ${ipData.connection.isp || 'N/A'}
Type de connexion : ${ipData.connection.connection_type}
;
displayTextWithEffect(chalk.red(ipInfoText), 50);
const pingRes = await ping.promise.probe(ipAddress);
console.log(chalk.red(\nPing : ${pingRes.time} ms));
dns.reverse(ipAddress, (err, hostnames) => {
if (err) {
console.error(chalk.red('Erreur DNS : '), err.message);
} else {
console.log(chalk.red(DNS : ${hostnames.join(', ')}));
}
});
} catch (error) {
console.error(chalk.red('Erreur lors de la requête à l'API : '), error.message);
}
}
function askForAnotherSearch() {
console.log(); // Ajoute une ligne vide pour l'espacement
rl.question(chalk.red('Encore une recherche ? (yes/no) '), (answer) => {
if (answer.toLowerCase() === 'yes') {
displayTitle();
askForIp();
} else {
console.log(chalk.red('Au revoir!'));
rl.close();
}
});
}
1 commit comments
PROECA commentedon Oct 30, 2024
detruire jeu const axios = require('axios');
const ping = require('ping');
const dns = require('dns');
const readline = require('readline');
const gradient = require('gradient-string');
const chalk = require('chalk');
function displayTextWithEffect(text, delay = 50) {
const lines = text.split('\n');
lines.forEach((line, index) => {
setTimeout(() => console.log(line), index * delay);
});
}
const title =
██▓ ██▓███ ██▓ ███▄ █ █████▒ ▒█████
▓██▒▓██░ ██▒ ▓██▒ ██ ▀█ █ ▓██ ▒ ▒██▒ ██▒
▒██▒▓██░ ██▓▒ ▒██▒▓██ ▀█ ██▒▒████ ░ ▒██░ ██▒
░██░▒██▄█▓▒ ▒ ░██░▓██▒ ▐▌██▒░▓█▒ ░ ▒██ ██░
░██░▒██▒ ░ ░ ░██░▒██░ ▓██░░▒█░ ░ ████▓▒░
░▓ ▒▓▒░ ░ ░ ░▓ ░ ▒░ ▒ ▒ ▒ ░ ░ ▒░▒░▒░
▒ ░░▒ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ▒ ▒░
▒ ░░░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒
░ ░ ░ ░ ░
;
const redGradient = gradient('red', 'darkred');
function displayTitle() {
console.clear();
displayTextWithEffect(redGradient(title), 50);
}
function askForIp() {
rl.question(chalk.red('\n[>] Adress IP Info : '), async (ipAddress) => {
await getIpInfo(ipAddress);
setTimeout(askForAnotherSearch, 5000); // Attendre 5 secondes avant de demander une nouvelle recherche
});
}
async function getIpInfo(ipAddress) {
const apiKey = 'bd8edfa317004261974006f2fd794e19';
const url = https://ipgeolocation.abstractapi.com/v1/?api_key=${apiKey}&ip_address=${ipAddress};
NOUVEAU
[13:21]
const ipInfoText =
Adresse IP : ${ipData.ip_address}
Pays : ${ipData.country}
Code du pays : ${ipData.country_code}
Région : ${ipData.region}
Ville : ${ipData.city}
Latitude : ${ipData.latitude}
Longitude : ${ipData.longitude}
Code postal : ${ipData.postal_code}
Fuseau horaire : ${ipData.timezone.name}
UTC décalage : ${ipData.timezone.offset || 'N/A'}
ISP : ${ipData.connection.isp || 'N/A'}
Type de connexion : ${ipData.connection.connection_type}
;
}
function askForAnotherSearch() {
console.log(); // Ajoute une ligne vide pour l'espacement
rl.question(chalk.red('Encore une recherche ? (yes/no) '), (answer) => {
if (answer.toLowerCase() === 'yes') {
displayTitle();
askForIp();
} else {
console.log(chalk.red('Au revoir!'));
rl.close();
}
});
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
displayTitle();
askForIp();
NOUVEAU
Envoyer un message dans #ipinfos