-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathippin.js
101 lines (91 loc) · 2.58 KB
/
ippin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/data/data/com.termux/files/usr/bin/node
//Author prince kumar Date 29 sep 2021....
//#Import all modules...
const chalk = require("chalk")
const axios = require("axios")
const { Command } = require('commander');
const program = new Command();
program
.name('ippin')
.description('Track IPv4 and IPv6 with realtime location.')
.version('1.0.1');
program
.option('-i, --ip [string]', 'Enter a ip address to track');
program.parse(process.argv);
const options = program.opts();
//Make a function For bamner....
function banner(){
console.clear()
console.log(chalk.red(`
_ ___ ___ _ _
| | | |_) | |_) | | | |\\ |
|_| |_| |_| |_| |_| \\|
`));
console.log(chalk.white(` █▓▒░░MADE BY PRINCE░░▒▓█
`));
}
banner()
//Habdle the user argument...
if ( !options.ip ){
console.log("Uses use ./ippin --help or -h ");
console.log("./ippin -i <ip address>");
}
else
{
trackIp(options.ip);// Take Target ip to handle the request...
}
function trackIp(tIp){
if (tIp == undefined){
var url = `http://ip-api.com/json`
console.log();
}
else{
var url = `http://ip-api.com/json/${tIp}`
console.log(url);
}
// Take the location now...
axios.get(url)
.then((res) =>{
setTimeout(()=>{console.log(chalk.red("⭕_____COUNTRY_____⭕"));},200);
setTimeout(()=>{
console.log(" 👇 ");
console.log(chalk.green(`${res.data.country}`));
},300);
setTimeout(()=>{console.log(chalk.red("⭕_____REGION_____⭕"));},400);
setTimeout(()=>{
console.log(" 👇 ");
console.log(chalk.green(`${res.data.regionName}`));
},500);
setTimeout(()=>{
console.log(chalk.red("⭕_____CITY_____⭕"));
console.log(" 👇 ");
console.log(chalk.green(`${res.data.city}`));
},600)
setTimeout(()=>{
console.log(chalk.red("⭕_____DISTRICT_____⭕"));
console.log(" 👇 ");
console.log(chalk.green(`${res.data.distric}`));
},700)
setTimeout(()=>{
console.log(chalk.red("⭕_____TIMEZONE_____⭕"));
console.log(" 👇 ");
console.log(chalk.green(`${res.data.timezone}`));
},800);
setTimeout(()=>{
console.log(chalk.red("⭕_____LOCATION_____⭕"));
console.log(" 👇 ");
console.log(chalk.green(`LATITUDE : ${res.data.lat}`));
console.log(chalk.green(`LINGITUDE : ${res.data.lon}`));
},1000)
setTimeout(()=>{
console.log(chalk.red("⭕_______ISP_______⭕"));
console.log(" 👇 ");
console.log(chalk.green(`${res.data.isp}`));
},1200)
setTimeout(()=>{
console.log(chalk.red("⭕_____TARGET_____⭕"));
console.log(" 👇 ");
console.log(chalk.green(`${res.data.query}`));
},1400);
})
}