-
Notifications
You must be signed in to change notification settings - Fork 1
/
iplocation.py
71 lines (58 loc) · 3.07 KB
/
iplocation.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
import os
import requests
import json
import random
import platform
head = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0" }
cores = ['\033[1;31m', '\033[1;32m', '\033[1;33m', '\033[1;34m', '\033[1;35m', '\033[1;36m', '\033[1;37m', '\033[90m', '\033[31m', '\033[31m', '\033[32m', '\033[33m', '\033[34m', '\033[35m', '\033[36m', '\033[37m', '\033[90m', '\033[m']
def sys_clear():
if platform.system() == "Linux":
os.system("clear")
elif platform.system() == "Windows":
os.system("cls")
else:
os.system("clear")
def banner():
logo = """
___ ____ _ _ _
|_ _| _ \\| | ___ ___ __ _| |_(_) ___ _ __
| || |_) | | / _ \\ / __/ _` | __| |/ _ \\| '_ \\
| || __/| |__| (_) | (_| (_| | |_| | (_) | | | |
|___|_| |_____\___/ \___\__,_|\__|_|\___/|_| |_|
"""
print(random.choice(cores) + logo)
print "\t\033[1;37m--[ \033[1;31mAutor\033[1;37m: \033[1;31mHagbard Celine"
print "\t\033[1;37m--[ \033[1;32mGrupo\033[1;37m: \033[1;32mFHC \033[1;37m- \033[1;32mFR13NDs Hackers Club"
print "\t\033[1;37m--[ \033[1;33mFacebook\033[1;37m: \033[1;33mhttps://www.facebook.com/miraldino.paulodoria.3"
print "\t\033[1;37m--[ \033[1;35mFB Page\033[1;37m: \033[1;35mhttps://www.facebook.com/termuxoficial\n\033[m"
sys_clear()
banner()
ip = raw_input("\033[1;36m[\033[1;31mhagbardceline\033[1;33m@\033[1;32miplocation\033[1;36m]-[\033[1;31mIP\033[1;36m]\033[1;31m.# ")
url = "http://api.ipstack.com/%s?access_key=8352f5f9bc6d52c4ee3e9193c439f822" % ip
req = requests.get(url, headers=head)
code = req.status_code
if code == 200:
html = req.text
iplocation = json.loads(html)
sys_clear()
banner()
print "\033[1;37m=============== \033[1;36mRESULTADOS\033[m \033[1;37m==============="
print "\033[1;33mIP: \033[1;31m%s" % iplocation['ip']
print "\033[1;33mType IP: \033[1;31m%s" % iplocation['type']
print "\033[1;33mContinent_code: \033[1;31m%s" % iplocation['continent_code']
print "\033[1;33mContinent_name: \033[1;31m%s" % iplocation['continent_name']
print "\033[1;33mCountry_code: \033[1;31m%s" % iplocation['country_code']
print "\033[1;33mCountry_name: \033[1;31m%s" % iplocation['country_name']
print "\033[1;33mRegion_code: \033[1;31m%s" % iplocation['region_code']
print "\033[1;33mRegion_name: \033[1;31m%s" % iplocation['region_name']
print "\033[1;33mCity: \033[1;31m%s" % iplocation['city']
print "\033[1;33mZip: \033[1;31m%s" % iplocation['zip']
print "\033[1;33mLatitude: \033[1;31m%s" % iplocation['latitude']
print "\033[1;33mLongitude: \033[1;31m%s" % iplocation['longitude']
print "\033[1;33mGeoname_id: \033[1;31m%s" % iplocation['location']['geoname_id']
print "\033[1;33mCapital: \033[1;31m%s" % iplocation['location']['capital']
#print "Languages: %s" % iplocation['location']['languages'][0]
print "\033[1;33mCalling_code: \033[1;31m+%s" % iplocation['location']['calling_code']
print "\033[1;33mIs_eu: \033[1;31m%s" % iplocation['location']['is_eu']
#print "Time_zone_id: %s" % iplocation['location']['time_zone']['id']
print "\033[m\033[1;37m==========================================\033[m"