-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathip-tracker.py
165 lines (128 loc) · 5.03 KB
/
ip-tracker.py
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
##########thelinuxuxer-choice#################
#############subodha prabash ##########
###########ip tracker v 1 ######
# importing the necessary packages
import time
import sys
import os
# Function for implementing the loading animation
def load_animation():
# String to be displayed when the application is loading
load_str = "loading ip-tracker by linuxuser-choice..."
ls_len = len(load_str)
# String for creating the rotating line
animation = "|/-\\"
anicount = 0
# used to keep the track of
# the duration of animation
counttime = 0
# pointer for travelling the loading string
i = 0
while (counttime != 30):
# used to change the animation speed
# smaller the value, faster will be the animation
time.sleep(0.075)
# converting the string to list
# as string is immutable
load_str_list = list(load_str)
# x->obtaining the ASCII code
x = ord(load_str_list[i])
# y->for storing altered ASCII code
y = 0
# if the character is "." or " ", keep it unaltered
# switch uppercase to lowercase and vice-versa
if x != 32 and x != 46:
if x>90:
y = x-32
else:
y = x + 32
load_str_list[i]= chr(y)
# for storing the resultant string
res =''
for j in range(ls_len):
res = res + load_str_list[j]
# displaying the resultant string
sys.stdout.write("\r"+res + animation[anicount])
sys.stdout.flush()
# Assigning loading string
# to the resultant string
load_str = res
anicount = (anicount + 1)% 4
i =(i + 1)% ls_len
counttime = counttime + 1
# for windows OS
if os.name =="nt":
os.system("cls")
# for linux / Mac OS
else:
os.system("clear")
# Driver program
if __name__ == '__main__':
load_animation()
#####end loding######
def prCyan(skk): print("\033[96m {}\033[00m" .format(skk))
############banner
banner = r'''
.-.
v 1.0 /aa \_
accurate __\- / ) .-.
.-. (__/ / ip-tracker _/oo \
_/ ..\ / \ ( \v /__
( \ u/__ / \__ \/ ___)
\ \__) \_.-._._ ) .-. / \
/ \ `-` / ee\_ / \_
__/ \ __\ o/ ) \_.-.__ )
( _._.-._/ thelinux (___ \/ '-'
superfast '-' user- / \
choice _/ \ Please add star if you are
( __.-._/ enjoying this it will
'-' help me to create another tools
'''
prCyan(banner)
#######types
from time import sleep
import sys
print("█████████████████████████████████████")
line_1 = "███ip-tracker by subodha prabash ████ "
for x in line_1:
print(x, end='')
sys.stdout.flush()
sleep(0.1)
print("\n█████████████████████████████████████")
import sys
import os
################colors######
WARNING = '\033[93m' #nothing
def prYellow(skk): print("\033[93m {}\033[00m" .format(skk))
def prCyan(skk): print("\033[96m {}\033[00m" .format(skk))
def prGreen(skk): print("\033[92m {}\033[00m" .format(skk))
def prRed(skk): print("\033[91m {}\033[00m" .format(skk))
prGreen(" SELECT NO 1 TO GET DETAILS ABOUT YOUR IP ")
prGreen(" SELECT NO 2 TO TRACK AND GET DETAILS ABOUT IP ")
prGreen(" SELECT ANY KEY TO EXIT THE SCRIPT ")
option = input(''' ┌─[ ip-tracker@thelinuxuser-choice ]─[~]
└──╼ # ''')
##############code
while True:
if option == "1":
################section 1
from requests import get
myip = get('https://ipapi.co/json/')
prYellow(myip.json())
import sys
sys.exit()
elif option == "2" :
###############section 2
from requests import get
ip = input("enter your ip here:")
track = get(f'https://ipapi.co/{ip}/json/')
prYellow(track.json())
import sys
sys.exit()
else:
##############exit section
prRed("closing....")
prRed("thank you!")
prRed("also make sure to add a star")
import sys
sys.exit()