Spaces:
Running
Running
BraydenMoore
commited on
Commit
·
163719b
1
Parent(s):
840ee3e
Update main.py
Browse files
main.py
CHANGED
@@ -41,7 +41,8 @@ def index():
|
|
41 |
url = feed_dict[feed]['url']
|
42 |
ip = ''.join(url.split('//')[-1]).split(':')[0]
|
43 |
info = get_ip_info(ip)
|
44 |
-
|
|
|
45 |
org = info['org'].lower()
|
46 |
timezone = pytz.timezone(info['timezone'])
|
47 |
time = dt.datetime.now(timezone)
|
@@ -49,7 +50,7 @@ def index():
|
|
49 |
print(info)
|
50 |
X, Y = latlon_to_pixel(info['loc'])
|
51 |
proxy_url = 'proxy/' + url.split('http://')[-1]
|
52 |
-
return render_template('index.html', name=name, url=proxy_url, info=info, time=time, ip=ip, org=org, loc=loc, X=X, Y=Y)
|
53 |
|
54 |
if __name__ == '__main__':
|
55 |
app.run(host='0.0.0.0', port='7860', debug=True)
|
|
|
41 |
url = feed_dict[feed]['url']
|
42 |
ip = ''.join(url.split('//')[-1]).split(':')[0]
|
43 |
info = get_ip_info(ip)
|
44 |
+
country = (pycountry.countries.get(alpha_2=info['country']).name).lower()
|
45 |
+
name = (info['city'] + ", " + info['region'] + ", " + country).lower()
|
46 |
org = info['org'].lower()
|
47 |
timezone = pytz.timezone(info['timezone'])
|
48 |
time = dt.datetime.now(timezone)
|
|
|
50 |
print(info)
|
51 |
X, Y = latlon_to_pixel(info['loc'])
|
52 |
proxy_url = 'proxy/' + url.split('http://')[-1]
|
53 |
+
return render_template('index.html', name=name, url=proxy_url, info=info, country=country, time=time, ip=ip, org=org, loc=loc, X=X, Y=Y)
|
54 |
|
55 |
if __name__ == '__main__':
|
56 |
app.run(host='0.0.0.0', port='7860', debug=True)
|