BraydenMoore commited on
Commit
400820b
1 Parent(s): 8055803

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -45,8 +45,8 @@ def get_location(ip):
45
  return {'country': location['country']['names']['en'] if 'country' in location else 'unknown country',
46
  'city': location['city']['names']['en'] if 'city' in location else 'unknown city',
47
  'region': location['subdivisions'][0]['names']['en'] if 'subdivisions' in location else 'unknown region',
48
- 'loc': str(location['location']['latitude']) + ',' + str(location['location']['longitude']),
49
- 'timezone': location['location']['time_zone'] if 'time_zone' in location['location'] else 'America/New_York'}
50
  else:
51
  return {'country': 'unknown country',
52
  'city': 'unknown city',
 
45
  return {'country': location['country']['names']['en'] if 'country' in location else 'unknown country',
46
  'city': location['city']['names']['en'] if 'city' in location else 'unknown city',
47
  'region': location['subdivisions'][0]['names']['en'] if 'subdivisions' in location else 'unknown region',
48
+ 'loc': str(location['location']['latitude']) + ',' + str(location['location']['longitude']) if 'location' in location else '0,0',
49
+ 'timezone': location['location']['time_zone'] if 'location' in location and 'time_zone' in location['location'] else 'America/New_York'}
50
  else:
51
  return {'country': 'unknown country',
52
  'city': 'unknown city',