Kvikontent commited on
Commit
fd46906
·
verified ·
1 Parent(s): ce14741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -26
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import streamlit as st
2
  import requests
3
 
4
  def get_ip():
@@ -22,28 +22,28 @@ def get_location(ip_address):
22
  }
23
  return location_data
24
 
25
- st.title("Hack any ip adress and get info")
26
  get = st.selectbox(
27
- 'Choose way to get ip adress',
28
  ("Input", "Get yours")
29
  )
30
  if get == "Input":
31
- ip = st.text_input("Enter IP adress")
32
  sub = st.button("Hack")
33
  if sub:
34
  data = get_location(ip)
35
  if data:
36
- st.header(f"""Information that we searched for this ip address: {data[0]}
37
- City: {data[1]}
38
- Region: {data[2]}
39
- Country: {data[3]}
40
- Postal code: {data[4]}
41
- Latitude: {data[5]}
42
- Longitude: {data[6]}
43
- Timezone: {data[7]}
44
- UTC Offset: {data[8]}
45
- Country Calling Code: {data[9]}
46
- Country Population: {data[10]}""")
47
 
48
  if get == "Get yours":
49
  ip = get_ip()
@@ -51,14 +51,14 @@ if get == "Get yours":
51
  if sub:
52
  data = get_location(ip)
53
  if data:
54
- st.header(f"""Information that we searched for this ip address: {data[0]}
55
- City: {data[1]}
56
- Region: {data[2]}
57
- Country: {data[3]}
58
- Postal code: {data[4]}
59
- Latitude: {data[5]}
60
- Longitude: {data[6]}
61
- Timezone: {data[7]}
62
- UTC Offset: {data[8]}
63
- Country Calling Code: {data[9]}
64
- Country Population: {data[10]}""")
 
1
+ import streamlit as st
2
  import requests
3
 
4
  def get_ip():
 
22
  }
23
  return location_data
24
 
25
+ st.title("Hack any ip address and get info")
26
  get = st.selectbox(
27
+ 'Choose way to get ip address',
28
  ("Input", "Get yours")
29
  )
30
  if get == "Input":
31
+ ip = st.text_input("Enter IP address")
32
  sub = st.button("Hack")
33
  if sub:
34
  data = get_location(ip)
35
  if data:
36
+ st.markdown(f"""Information that we searched for this ip address: {data['ip']}
37
+ City: {data['city']}
38
+ Region: {data['region']}
39
+ Country: {data['country']}
40
+ Postal code: {data['postalcode']}
41
+ Latitude: {data['latitude']}
42
+ Longitude: {data['longitude']}
43
+ Timezone: {data['timezone']}
44
+ UTC Offset: {data['utc_offset']}
45
+ Country Calling Code: {data['country_calling_code']}
46
+ Country Population: {data['country_population']}""")
47
 
48
  if get == "Get yours":
49
  ip = get_ip()
 
51
  if sub:
52
  data = get_location(ip)
53
  if data:
54
+ st.markdown(f"""Information that we searched for this ip address: {data['ip']}
55
+ City: {data['city']}
56
+ Region: {data['region']}
57
+ Country: {data['country']}
58
+ Postal code: {data['postalcode']}
59
+ Latitude: {data['latitude']}
60
+ Longitude: {data['longitude']}
61
+ Timezone: {data['timezone']}
62
+ UTC Offset: {data['utc_offset']}
63
+ Country Calling Code: {data['country_calling_code']}
64
+ Country Population: {data['country_population']}""")